반응형 Linux97 원격호스트에서 ssh 세션을 이용한 rsync 명령으로 파일/디렉토리 복사 원격호스트에서 ssh 세션을 이용한 rsync 명령으로 파일/디렉토리 복사 예) rsync -r -v -u -z --delete -e "ssh -p 22" ~/my_dir john@my_server.net:/home/john/my_backup 예) [root@localhost test]# rsync -v -u -a --delete --rsh=ssh --stats root@172.28.71.45:/home/student1 . root@172.28.71.45's password: receiving file list ... done student1/ student1/.bash_logout student1/.bash_profile student1/.bashrc student1/test.txt student1/... 2018. 1. 14. Superblock 손상을 입었을 경우 복구 방법 http://docs.sun.com/app/docs/doc/805-7228/6j6q7uf0i?a=view When the superblock of a file system becomes damaged, you must restore it. fsck tells you when a superblock is bad. Fortunately, redundant copies of the superblock are stored within a file system. You can use fsck -o b to replace the superblock with one of the copies. How to Restore a Bad Superblock 1. Become superuser. 2. Change to a di.. 2018. 1. 14. Fail2ban을 이용한 Brute Force 공격 막기 Fail2ban을 이용한 Brute Force 공격 막기 1. yum으로 패키지 설치 yum install fail2ban 2. 설정 파일 구성 vi /etc/fail2ban/jail.conf ----------//--------- [DEFAULT] # "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not # ban a host which matches an address in this list. Several addresses can be # defined using space separator. ignoreip = 127.0.0.1 2018. 1. 14. awk 명령어 awk 명령어 awk '/west/' datafile : west 라는 글이 있는 줄 출력 awk '/^north/' datafile : north로 시작하는 줄 출력 awk '/^(no | so)/' datafile : no 또는 so 로 시작하는 줄 출력 awk '{ print $3, $2 }' datafile : datafile 리스트의 세 번째 와 두 번째 필드를 스페이스로 띄어서 출력 awk '{ print $3 $2 }' datafile : datafile 리스트의 세 번째 와 두 번째 필드를 그냥 붙여서 출력 awk '{ print "Number of fields : " NF} ' datafile : datafile의 각 줄마다의 필드수를 리턴한다. awk '$5 ~ /\.[7-9]+/' d.. 2018. 1. 14. 리눅스 시스템 모니터링 툴 20가지 리눅스 시스템 모니터링 툴 20가지 from: http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html Need to monitor Linux server performance? Try these built-in command and a few add-on tools. Most Linux distributions are equipped with tons of monitoring. These tools provide metrics which can be used to get information about system activities. You can use these tools to find the possible causes of a perform.. 2018. 1. 14. 쉘 스크립트 (Shell Script) 쉘 스크립트 (Shell Script) - (Ⅰ) 어떤 것이 쉘 스크립트? 우리는 알게 모르게 많은 쉘 스크립트을 사용한다. 그렇다면 어떤 것이 쉘스크립트인가? 확인을 해보는 방법은 file와 grep명령을 사용해서 찾아보는 것이다. 필자의 시스템에서의 결과는 다음과 같다. $ (cd /bin ; file * |grep “shell script”) false : Bourne shell script text igawk : Bourne shell script text remadmin : Bourne shell script text true : Bourne shell script text $ (cd /usr/bin ; file * |grep “shell script”) anytopnm : Bourne shel.. 2018. 1. 14. ModSecurity 구버전 2.5, 2.7 다운로드 ModSecurity 구버전 2.5, 2.7 다운로드 아파치 웹방화벽 모듈인 mod_security 버전이 2.9.2가 최신이다. 2.9 버전대로 변경되면서, 구버전에서 적용된 룰이 적용되지 않는다.구 버전의 룰을 적용하려면, 구버전용 프로그램을 다운받아 설치하여야 한다. https://sourceforge.net/projects/mod-security/files/modsecurity-apache/ 2.7.0, 2.6.8, 2.5.13 최신버전 다운로드http://www.modsecurity.org/ ModSecurity 매뉴 [영문]https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual *** 참고사이트 *** 공개웹방화벽 ModSecurity.. 2017. 9. 27. CentOS 6 apache 2.4 modsecurity 2.9 compile install CentOS 6 apache 2.4 modsecurity 2.9 compile install 어플리케이션 계정 생성# useradd -d /app app# passwd appChanging password for user app.New password:Retype new password:passwd: all authentication tokens updated successfully.의존 패키지 설치# yum install gcc gcc-c++ make perl zip unzip wget git zlib-devel libxml2 libxml2-devel ncurses ncurses-devel expat expat-devel소스파일 다운로드# mkdir /app/src/# cd /app/src# wget .. 2017. 9. 27. 리눅스 하드디스크 온도측정 리눅스 하드디스크 온도측정 hddtemp 프로그램 설치 설치yum install hddtemp 실행 예 hddtemp /dev/sdb * 하드디스크 S.M.A.R.T. 기능이 지원되어야함.. 레이드구성 안됨. 2017. 9. 6. 리눅스 온도체크(lm_sensors), sensor 리눅스 CPU 온도 체크 lm_sensors 모듈이 CPU온도를 체크한다. * CentOS 기준으로... 설치하기 yum install lm_sensors 설정sensors-detect 실행sensors 실시간으로 모니터링을 진행하시고 싶다면 watch를 이용해주세요. # watch sensors 2017. 9. 6. 디스크 dd Copy를 이용한 Backup 방법 디스크 dd Copy를 이용한 Backup 방법 1. 개요 해당 글은 리눅스 상에서 디스크 대 디스크를 백업하는 방법에 대한 내용이다. 흔히 dd카피라고 부르는 방법이며 이 방법의 제약 사항은 아래와 같다. 1) 디스크의 용량이 같아야 한다. 2) 일부 시스템의 경우 원본 디스크가 장착 된 시스템의 기종과 복사 디스크가 장착 될 시스템의 기종이 같아야 한다. 3) 원본 디스크의 filesystem에 문제가 있을 시 dd카피를 통해 백업을 하면 문제가 있는 filesystem의 내용도 copy 된다. 2. 작업 내용 2.1 시스템 종료 및 디스크 장착 시스템을 절차에 따라 종료하고 복사할 디스크를 장착한다. 시스템 부팅 2.2 운영체제 선택 가장 권장하는 작업 환경은 rescue 모드를 통해 부팅한 운영체.. 2017. 9. 6. CentOS_Geoip 설치 및 사용법 GeoIP 설치 및 사용법 1)테스트 환경* iptables >= 1.4.3* kernel-source >= 2.6.29* libmnl* Linux kernel >= 2.6.3 2)패키지 설치yum install gcc gcc-c++ make automake unzip zip xz kernel-devel-`uname -r` iptables* kernel-* libmnl* rpm -i http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpmyum install perl-Text-CSV_XS wget http://www.maxmind.com/download/geoip/database/GeoIPCountryCSV.zipunz.. 2017. 9. 6. 이전 1 ··· 4 5 6 7 8 9 다음 반응형