본문 바로가기

운영체제

(83)
grep, sed 정확하게 일치하는 문자열 다루기 예제 파일: sample.txt 1 banana 1000 2 apple 2000 3 apple2 2000 4 strawberry 3000 5 milk 2500 6 milk2 3500 1. grep 명령어: 단어 양쪽에 \b > grep "\bapple\b" sample.txt 결과 2 apple 2000 2. sed 명령어 > sed 's/\bapple\b/APPLE/' sample.txt 결과 1 banana 1000 2 APPLE 2000 3 apple2 2000
firewall-cmd 명령어 firewalld 는 Redhat 7까지는 백엔드로 iptables, 8버전이후로는 nftables 프레임워크를 사용하여 방화벽 설정한다. 그래서 Redhat 7버전에서 iptables 명령어로 확인하면 firewall-cmd에서 설정한 정보를 확인할수 있으나 Redhat 8 이상 버전에서 iptables로 확인하면 firwall-cmd 에서 설정한 정보가 표시되지 않는다. Redhat 8 이상버전에서는 nftables(nft command) 로 firwalld 설정을 볼수가 있다. [1]. firewall-cmd 서비스 시작 > systemctl start firewalld > systemctl status firewalld [2]. firewall-cmd ZONE 관리 1. Default Zone 설..
iptables 명령어 1. iptables rule 확인 > iptables -nL --line-numbers 2. 특정 체인(INPUT,OUTPUT,FORWARD... 등)만 보기 > iptables -nL INPUT --line-numbers 3. rule 추가 > iptables -A INPUT --source 192.168.219.10 -p tcp --dport 22 -j ACCEPT 4. rule 교체 > iptables -R INPUT 3 --source 192.168.219.40 -p tcp --dport 22 -j ACCEPT 5. rule 삽입 > iptables -I INPUT 2 --source 192.168.219.40 -p tcp --dport 22 -j ACCEPT 6. rule 삭제 > iptabl..
TOP 명령어 정렬 개요 top 명령어에서 cpu,memory 사용량에 따라 정렬하는 방법 1. top 명령어에서 SHIFT+F 입력 Fields Management for window 1:Def, whose current sort field is %CPU Navigate with Up/Dn, Right selects for move then or Left commits, 'd' or toggles display, 's' sets sort. Use 'q' or to end! * PID = Process Id PGRP = Process Group OOMs = OOMEM Score c * USER = Effective Use TTY = Controlling T ENVIRON = Environment v * PR = Priori..
TOP 명령어 정렬 개요 top 명령어에서 cpu,memory등 사용량에 따라 정렬하는 방법 1. top 명령어에서 SHIFT+F 입력 Fields Management for window 1:Def, whose current sort field is %CPU Navigate with Up/Dn, Right selects for move then or Left commits, 'd' or toggles display, 's' sets sort. Use 'q' or to end! * PID = Process Id PGRP = Process Group OOMs = OOMEM Score c * USER = Effective Use TTY = Controlling T ENVIRON = Environment v * PR = Prior..
Openssh 서버 ACL 설정 개요 redhat 8 버전 부터는 tcp wrapper를 지원하지 않는 대신 openssh의 Match를 이용하여 특정 IP에 대해 ACL을 설정할수 있다. 1. sshd_config 파일 수정 예) 192.168.0.1 에 대해서만 접속을 허용하고 그외에는 모든 접속 차단 Match Address 192.168.0.1 MaxAuthTries 3 Match Address * MaxAuthTries 0 2. sshd 서비스 재시작 # systemctl restart sshd 3. 결과 $ ssh root@192.168.0.172 Received disconnect from 192.168.0.172 port 22:2: Too many authentication failures Disconnected from..
[Solaris] /tmp 파일시스템 크기 조정 1. 동적 조정 mount -F tmpfs -o remount,size=1024m swap /tmp 2. /etc/vfstab(영구설정) default) #swap - /tmp tmpfs - yes - 수정 swap - /tmp tmpfs - yes size=1024m - #(주석)제거 - 옵션 필드에 size=XXXm 크기 지정(메가단위로 지정) 참조 https://docs.oracle.com/cd/E36784_01/html/E36837/tmpfs-limit-1.html How to Limit the Size of the tmpfs File System - Oracle® Solaris 11 Security Guidelines How to Limit the Size of the tmpfs File Sys..
solaris 10 / 11 패키지 관리 명령어 개요 1. 파일이 속해 있는 패키지 1.1 solaris 10 syntax) pkgchk -l -p > pkgchk -l -p /usr/sbin/dtrace 1.2 solaris 11 syntax) pkg search -Hlo pkg.name > pkg search -Hlo pkg.name /usr/sbin/dtrace 2. 패키지에 포함된 파일 2.1 solaris 10 > grep SUNWdtrc /var/sadm/install/contents OR > pkgchk -l SUNWdtrc| grep Pathname 2.2 solaris 11 syntax) pkg contents > pkg contents system/dtrace 3. 패키지 정보 3.1 solaris 10 > pkginfo -l 3.2..