ssh免密

配置免密

1. ssh-keygen

2. cd ~/.ssh

3. cat id_rsa.pub >> authorized_keys

4. chmod 600 authorized_keys

5. scp authorized_keys omnisky@192.168.207.122:/home/omnisky/.ssh/.        # (omnisky: 用户名)

6. ssh 192.168.207.122     #(若是找不到用户名:ssh 用户名@192.168.207.122)

 

相互ping一下,ping baidu.com

1. 报错:ssh: connect to host 192.168.6.129 port 22: Connection refused

    解决:sudo apt install openssh-server    (所有机器都进行安装)

2. 报错:Permission denied (publickey)

    解决:打开 /etc/ssh/sshd_config ,修改PasswordAuthentication no 为: PasswordAuthentication yes

               重启服务 /etc/init.d/sshd restart

 

posted @ 2020-06-23 08:58  半日闲1  阅读(110)  评论(0编辑  收藏  举报