IT 기술문서/Redhat Linux

리눅스 명령어 모음

미니도라 2016. 7. 25. 09:19

리눅스 베드 체크
badblocks -v -o bedblock.txt /dev/sdb

 

 

체크디스크 (unmount 후 할것)
fsck /dev/sdb

 

 

리눅스 라벨 변경
# e2label /dev/sdb1 "/"

 


라벨 확인
blkid

 

 

리눅스 if exist 문 사용법

#!/bin/bash
FILE=$1
if [ -f $FILE ]; then
   echo "File '$FILE' Exists"
.sselse
   echo "The File '$FILE' Does Not Exist"
fi 

 

 

 

Samba 마운트

 mount -t cifs -o user='사용자이름',password='패스워드' //서버주소/공유폴더 마운트경로

사용자 이름 : testuser
패스워드 : 1234
서버주소 : 192.168.0.2
공유폴더 : cifs-test
마운트 경로 : /mount-test

mount -t cifs -o user='testuser',password='1234' //192.168.0.2/cifs-test /mount-test

 

 

텔넷 포트 변경

SSH서비스의 포트번호를 변경
/etc/ssh/sshd_config 파일에 있는 Port부분을 변경하면 된다.

telnet은 /etc/services


SSH 설정

vi /etc/ssh/sshd_config 들어가서

#Port 22  에서  # 지우고 Port 변경

 

vi /etc/services에 들어가서

22/tcp

22/udp

라고 적혀있는곳에 22를 변경

Telnet 설정

vi /etc/services  에 들어가서

9999/tcp

9999/udp

로 바꿔주면 된다.


변경한 후에는 서비스를 다시한번 실행해주면 된다.

service xinetd restart
service sshd restart

 

 

타임존 설정

ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime (한국)

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime (중국)

 

시간서버 살아있는지 확인

ntpdate -d time-a.nist.gov | tail -1

 

 

시간서버 리스트

server time.bora.net
restrict time.bora.net mask 255.255.255.255 nomodify notrap noquery
server time.nuri.net
restrict time.nuri.net mask 255.255.255.255 nomodify notrap noquery
server ntp.kornet.net
restrict ntp.kornet.net mask 255.255.255.255 nomodify notrap noquery
server time.kriss.re.kr
restrict time.kriss.re.kr mask 255.255.255.255 nomodify notrap noquery
server time.windows.com
restrict time.windows.com mask 255.255.255.255 nomodify notrap noquery
server time.nist.gov
restrict time.nist.gov mask 255.255.255.255 nomodify notrap noquery
server time-nw.nist.gov
restrict time-nw.nist.gov mask 255.255.255.255 nomodify notrap noquery
server time-a.nist.gov
restrict time-a.nist.gov mask 255.255.255.255 nomodify notrap noquery
server time-b.nist.gov
restrict time-b.nist.gov mask 255.255.255.255 nomodify notrap noquery
server 1.cn.pool.ntp.org
restrict 1.cn.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
server 1.kr.pool.ntp.org
restrict 1.kr.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
server 1.asia.pool.ntp.org
restrict 1.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
server 2.asia.pool.ntp.org
restrict 2.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
server 3.asia.pool.ntp.org
restrict 3.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
server ntp.postech.ac.kr
restrict ntp.postech.ac.kr mask 255.255.255.255 nomodify notrap noquery
server time.ewha.or.kr
restrict time.ewha.or.kr mask 255.255.255.255 nomodify notrap noquery
server ntp1.sjtel.net
restrict ntp1.sjtel.net mask 255.255.255.255 nomodify notrap noquery
server time.nuri.net
restrict time.nuri.net mask 255.255.255.255 nomodify notrap noquery
server clock.iptime.co.kr
restrict clock.iptime.co.kr mask 255.255.255.255 nomodify notrap noquery
server time.lgqps.com
restrict time.lgqps.com mask 255.255.255.255 nomodify notrap noquery
server time.wonkwang.ac.kr
restrict time.wonkwang.ac.kr mask 255.255.255.255 nomodify notrap noquery
server time1.daum.net
restrict time1.daum.net mask 255.255.255.255 nomodify notrap noquery
server time2.daum.net
restrict time2.daum.net mask 255.255.255.255 nomodify notrap noquery
server ntp1.gngidc.net
restrict ntp1.gngidc.net mask 255.255.255.255 nomodify notrap noquery
server ntp2.gngidc.net
restrict ntp2.gngidc.net mask 255.255.255.255 nomodify notrap noquery
server ntp1.cs.pusan.ac.kr
restrict ntp1.cs.pusan.ac.kr mask 255.255.255.255 nomodify notrap noquery
server ntp2.cs.pusan.ac.kr
restrict ntp2.cs.pusan.ac.kr mask 255.255.255.255 nomodify notrap noquery
server time.apple.com
restrict time.apple.com mask 255.255.255.255 nomodify notrap noquery

 

 

새 하드웨어 추가

/usr/sbin/kudzu

Kudzu는 시스템 부팅시에 실행되어 추가된 하드웨어나 제거된 하드웨어를 찾아내는 하드웨어 탐색 도구입니다

래드햇 9.0에 들어있는 PnP유틸입니다. 일단 이걸로 잡아 보시고요...아참, kudzu쓰실때는 X윈도우가 아닌 콘솔상태에서 하셔야 합니다. X윈도우에서 마우스가 먹통이 되는 현상이 있습니다.혹시 모르는 경우를 대비한것입니다. 설치 막 하시고 나서 재부팅 하시고나면, 새로운 기기들을 잡았다고 kudzu가 시작됩니다.

 

 

반응형