반응형
[리눅스 명령어]CentOS : man chkconfig
 
1. 용도 및 목적
시스템 서비스에 대한 런레벨 정보 업데이트 및 쿼리
[CentOS 6.X 이하]
 
2. 자주 쓰는 옵션
-iptables 서비스 런레벨별 기동 상태 확인
#chkconfig iptables --list
 
-iptables 서비스 off(기동 시 iptables 자동시작 안함)
#chkconfig iptables off
 
-iptables 서비스 on(기동 시 iptables 자동시작)
#chkconfig iptables on
 
-iptables 서비스 런레벨별(3,5) 설정
#chkconfig --level 35 iptables off
반응형
반응형
[리눅스 명령어]CentOS : man diff
 
1. 용도 및 목적
파일 비교
 
2. 자주 쓰는 옵션
-비교
#diff test test1
 
3. 활용 방법
-디렉토리 비교(하위파일도 비교)
#diff -ur test test1
 
-상세히 비교
#diff -c test test1
 
-대소문자 차이 무시
#diff -i test test1
반응형
반응형
[리눅스 명령어]CentOS : man scp
 
1. 용도 및 목적
복사(minimal 설치 시 포함 안됨 yum 설치 또는 단일 패키지이니 다운 받아 설치)
 
2. 자주 쓰는 옵션
-로컬의 test.tgz 를 192.168.35.11 서버의 /home/test/ 디렉토리로 복사
#scp test.tgz 192.168.35.11:/home/test/
 
-로컬의 test.tgz 를 192.168.35.11 서버의 /home/test/ 디렉토리로 1000 Kbit/s 속도로 복사(중요 : 상용장비에서 이옵션 없이 기가단위의 파일전송시 네트워크 대역폭을 모두 차지할수 있다)
#scp -l 1000 test.tgz 192.168.35.11:/home/test/
 
-로컬의 test 디렉토리 및 하위 파일 포함하여 192.168.35.11 서버의 /home/test/ 디렉토리로 복사
#scp -r test/ 192.168.35.11:/home/test/
반응형
반응형
[리눅스 명령어]CentOS : man service
 
1. 용도 및 목적
System V init 스크립트 실행
[CentOS 6.X 이하]
 
2. 자주 쓰는 옵션
-iptables 상태 확인
#service iptables status
 
-iptables 시작
#service iptables start
 
-iptables 중지
#service iptables stop
반응형
반응형
[리눅스 명령어]CentOS : man sed
 
1. 용도 및 목적
텍스트 필터링 출력 및 변환을 위한 스트림 편집기
 
2. 자주 쓰는 옵션
-/etc/selinux/config 파일의 SELINUX=enforcing 를 SELINUX=disabled로 변경
#sed -i "s/^SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
 
-/etc/pam.d/system-auth  파일의 pam_env.so 문구 뒤에 행을 변경하여 auth        required      pam_tally2.so onerr=fail deny=5 를 추가
#sed -i "/pam_env.so/aauth        required      pam_tally2.so onerr=fail deny=5" /etc/pam.d/system-auth
 
-/etc/pam.d/system-auth  파일의 deny=5 문구가 포함된 라인 삭제
#sed -i "/deny=5/d" /etc/pam.d/system-auth
 
-/home/test  파일의 공백라인 삭제
#sed -i "/^$/d" /home/test
 
-/home/test  파일의 공백라인 삭제
#sed -i "/^$/d" /home/test
 
-특정 라인 출력
#sed -n "1p" /home/test
 
-selinux disable
#sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
반응형
반응형
[리눅스 명령어]CentOS : man systemctl
 
1. 용도 및 목적
시스템화 된 시스템 및 서비스 관리자 제어
[CentOS 7.X 이상]
 
2. 자주 쓰는 옵션
-firewalld 상태 확인
#systemctl status firewalld.service
 
-firewalld 시작
#systemctl start firewalld.service
 
-firewalld 중지
#systemctl stop firewalld.service
 
-firewalld 자동시작 설정 확인
#systemctl list-unit-files firewalld.service
 
-firewalld 자동시작 등록
#systemctl enable firewalld.service
 
-firewalld 자동시작 삭제
#systemctl disable firewalld.service
 
3. 활용 방법
 
/usr/lib/systemd/system/new.service
----new
 
[Unit]
Description=new Service
After=network.target
 
[Service]
Type=forking
ExecStart=new start
ExecStop=new stop
 
/usr/lib/systemd/system/new2.service
----new2.d
 
[Unit]
Description=new2Service
Requires=new.target
 
[Service]
Type=forking
ExecStart=new2 start
ExecStop=new2 stop
반응형
반응형
[리눅스 명령어]CentOS : man man
 
1. 용도 및 목적
메뉴얼 확인(minimal 설치 시 포함 안됨 yum 설치 또는 단일 패키지이니 다운 받아 설치)
 
2. 자주 쓰는 옵션
-설치 
#yum install man
 
-메뉴얼 확인
man 명령어
 
3. 활용 방법
-메뉴얼 리스트 확인( . 은 임의의 문자를 의미하는 정규식)
#man -k .
#apropos .
반응형
반응형
[리눅스 명령어]CentOS : man nmap
 
1. 용도 및 목적
네트워크 탐색 및 보안 도구, 포트 스캔(minimal 설치 시 포함 안됨 yum 설치 또는 단일 패키지이니 다운 받아 설치)
 
2. 자주 쓰는 옵션
-ping 확인
#nmap -sP 192.168.35.11
 
-TCP 포트 범위 확인
#nmap -sT -p 1-65535 192.168.35.11
 
-UDP 포트 범위 확인
#nmap -sU -p 1-65535 192.168.35.11
 
-일반적인 icmp 가 아닌 ack 패킷을 보낸 후 rst 로 응답 받기
#nmap -sT -PT -p 22 192.168.35.11
 
-일반적인 icmp 가 아닌 syn 패킷을 보내 스캔
#nmap -sT -PS -p 22 192.168.35.11
반응형
반응형
[리눅스 명령어]CentOS : man ldd
 
1. 용도 및 목적
프로그램의 공유 라이브러리 의존성 출력
 
2. 자주 쓰는 옵션
-프로그램의 공유라이브러리 출력(만약, not found 와 같은 에러 표출시 해당 라이브러리 설치 필요)
#ldd /usr/sbin/sshd
반응형
반응형
[리눅스 명령어]CentOS : man ethtool
 
1. 용도 및 목적
네트워크 드라이버 및 하드웨어 설정
 
2. 자주 쓰는 옵션
-network 드라이버 확인
#ethtool -i eth0
 
-network 포트 확인(하기 명령어를 실행하면 nic led가 점멸한다)
#ethtool -p eth0
-led 30회 점멸
#ethtool -p 30 eth0
 
-network 인터페이스 ring 값 확인
#ethtool -g eth0
 
3. 활용 방법
-network 인터페이스 ring 값 수정(확인한 값의 MAX 값 으로 수정 : 대량의 데이터로 drop 및 overrun 발생시)
#ethtool -G eth0 rx 4096 tx 4096
 
-network 인터페이스 drop 확인
#ethtool -S eth0 |grep -i drop
반응형

+ Recent posts