执行lsyncd时一直报错255

255说明登录是验证出现了问题

但是通过ssh -vv则可以正常登录远程服务器

那么问题出现在哪呢?折腾了几个小时才发现原来是ssh config配置文件写错了

路径为~/.ssh/config

下面是错误的配置文件



Host demo1                       
HostName 192.168.1.19          
User root                      
IdentityFile /demo/key1  
Port 22                      

Host demo2                       
HostName 192.168.1.138           
User root                      
IdentityFile /demo/key2
Port 22 

专业的认识就应该可以看出错在哪里了~~~下面是正确的ssh config文件



Host 192.168.1.19                        
HostName demo1          
User root                      
IdentityFile /demo/key1  
Port 22                      

Host 192.168.1.138                        
HostName demo2          
User root                      
IdentityFile /demo/key2
Port 22 

2020-12-26更新,笔误,,,正确的方式应该是如下

否则会出现ssh: Could not resolve hostname错误



    Host example                       # 自定义名称
    HostName example.com           # 主机IP地址或是域名
    User root                      # 登录用户名
    # IdentityFile ~/.ssh/id_ecdsa # 密匙认证文件
    # Port 22                      # 指定ssh端口

标签: none

添加新评论