1、ssh服务生成新的公钥和私钥[[email protected]_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 [email protected]_80
The key‘s randomart image is:
+--[ RSA 2048]----+
| . |
| . . |
| o |
| o . |
| S + = |
| . . =oo |
| o E=. |
| o.o+.o. |
| o+.+Bo |
+-----------------+
[[email protected]_80 ~]# ls .ssh/ id_rsa id_rsa.pub known_hosts #id_rsa私钥 id_rsa.pub公钥。
[[email protected]_80 ~]# ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected].168.3.84 #将公钥发布给84服务器后,80再次连接84就不需要再输入密码
[[email protected]_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 #无需输密码连接成功 [[email protected]_84 ~]#
5、SCP远程拷贝
6、xinetd 进程守护程序
[[email protected]_80 ~]# yum -y install xinetd
[[email protected]_80 ~]# vim /etc/xinetd.conf #配置文件
[[email protected]_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 \
[[email protected]_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
[[email protected]_80 ~]# service xinetd restart #启动xinetd服务 停止 xinetd: [失败] 正在启动 xinetd: [确定]
[[email protected]_80 ~]# netstat -anptu |grep 873 #检测是否正常监听873端口,有标示rsync服务正常启动。 tcp 0 0 :::873 :::* LISTEN 3945/xinetd
时间: 2024-11-07 06:51:55