三、SSH高級服務

   
   
   
   
一、ssh服務生成新的公鑰和私鑰[root@rhel6_80 ~]# ssh-keygen Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. #私鑰存放地址Your public key has been saved in /root/.ssh/id_rsa.pub. #公鑰存放地址The key fingerprint is:3e:ff:b3:68:de:e7:06:1b:fb:21:49:44:bb:38:76:e3 root@rhel6_80The key's randomart image is:+--[ RSA 2048]----+| . || . . || o || o . || S + = || . . =oo || o E=. || o.o+.o. || o+.+Bo |+-----------------+[root@rhel6_80 ~]# ls .ssh/ id_rsa id_rsa.pub known_hosts #id_rsa私鑰 id_rsa.pub公鑰。

   
   
   
   
[root@rhel6_80 ~]# ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.3.84 #將公鑰發佈給84服務器後,80再次鏈接84就不須要再輸入密碼[root@rhel6_80 ~]# ssh 192.168.3.84 Last login: Thu May 19 20:33:21 2016 from 192.168.3.130 警告!哈哈哈哈哈哈 PATH=/root/:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin #無需輸密碼鏈接成功 [root@rhel6_84 ~]#
 
    
    
    
    
[root@rhel6_80 ~]# lsaa.sh cc.sh fail2ban-0.8.14.tar.gz install.log ss.sh 公共的 視頻 文檔 音樂anaconda-ks.cfg dd.sh hh.sh install.log.syslog xx.sh 模板 圖片 下載 桌面[root@rhel6_80 ~]# tar xf fail2ban-0.8.14.tar.gz [root@rhel6_80 ~]# cd fail2ban-0.8.14[root@rhel6_80 fail2ban-0.8.14]# python -V Python 2.6.6 [root@rhel6_80 fail2ban-0.8.14]# python setup.py stall**************[root@rhel6_80 fail2ban-0.8.14]# cp files/redhat-initd /etc/init.d/fail2ban [root@rhel6_80 fail2ban-0.8.14]# chkconfig --add fail2ban #添加fail2ban 開機自啓 [root@rhel6_80 fail2ban-0.8.14]# chkconfig --list fail2ban fail2ban 0:關閉 1:關閉 2:關閉 3:啓用 4:啓用 5:啓用 6:關閉[root@rhel6_80 fail2ban-0.8.14]# cd /etc/fail2ban/ [root@rhel6_80 fail2ban]# ls action.d fail2ban.conf fail2ban.d filter.d jail.conf jail.d

四、fail2ban 設置
     
     
     
     
[root@rhel6_80 fail2ban]# fail2ban-client status #查看當前fail2ban設置


五、SCP遠程拷貝


六、xinetd 進程守護程序
   
   
   
   

[root@rhel6_80 ~]# yum -y install xinetd[root@rhel6_80 ~]# vim /etc/xinetd.conf #配置文件
[root@rhel6_80 ~]# yum -y install telnet-server tftp-server rsync #安裝測試用程序,測試被xinetd管理的程序
# default: off # description: The rsync server is a good addition to an ftp server, as it \[root@rhel6_80 ~]# vim /etc/xinetd.d/rsync #啓動rsync服務 # allows crc checksumming etc. service rsync { disable = no #這裏改爲no,表示啓動xinetd flags = IPv6 socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID[root@rhel6_80 ~]# service xinetd restart #啓動xinetd服務 中止 xinetd: [失敗] 正在啓動 xinetd: [肯定]
[root@rhel6_80 ~]# netstat -anptu |grep 873 #檢測是否正常監聽873端口,有標示rsync服務正常啓動。 tcp 0 0 :::873 :::* LISTEN 3945/xinetd



相關文章
相關標籤/搜索