xShell连接Linux服务器提示密码错误。 
1、检查虚拟机SSH服务是否开启: 
service sshd status,如果没有开启,请执行service sshd start启动该服务,或者通过service sshd restart重启该服务;

2、检查 /etc/ssh/ssh_config文件: 
ssh服务端口是否为22,Protocol协议版本是否为2(一般为2安全。1为ssh 1不安全,有可能禁止登陆); 
3、检查/etc/ssh/sshd_config: 

    # Authentication:
    LoginGraceTime 120
    PermitRootLogin without passwd
    StrictModes yes1234
改成
    # Authentication:
    LoginGraceTime 120
    PermitRootLogin yes
    StrictModes yes1234
或者
当SSH配置被注释掉时,将注释释放就可以。
重启虚拟机。

 

ssh连接localhost被拒绝

  1. ssh: connect to host localhost port 22: Connection refused  


按照hadoop官网上的操作



[plain] view plain copy

  1. $ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa  

  2. $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys  

  3. $ chmod 0600 ~/.ssh/authorized_keys  


还是不能连接


查看ubuntu机器上的ssh应该是只有ssh远程访问的客户端,而没有ssh-server,故安装openssh-server


[plain] view plain copy

  1. $ sudo apt-get install openssh-server  




搞定


[plain] view plain copy

  1. $ ssh localhost  

  2. The authenticity of host 'localhost (127.0.0.1)' can't be established.  

  3. ECDSA key fingerprint is SHA256:7FTkHoAyQ9yLqfLXI+GOOz/Ej7uBe1vJldjpsej+OuM.  

  4. Are you sure you want to continue connecting (yes/no)? no