Ubuntu 14.04 - BUG?SSH 登录失败

Ubuntu 14.04 - BUG?SSH 登录失败

Ubuntu 14.04 - 安装了 apt-get install openssh-server,用户名是 sun,密码是 1234,root 的密码也是 1234。

远程连接但不允许我。

suns-MacBook-Air:js sun$ ssh [email protected]
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied (publickey,password).

suns-MacBook-Air:js sun$ ssh [email protected]
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 

suns-MacBook-Air:js sun$ ssh [email protected]
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 

编辑:PC 正在使用 ipv4 和 ipv6

$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether d4:be:d9:fd:84:fe brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.6/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2a02:a03f:24af:bd00:898f:6294:6b5e:94f6/64 scope global temporary dynamic 
       valid_lft 345642sec preferred_lft 85306sec
    inet6 2a02:a03f:24af:bd00:d6be:d9ff:fefd:84fe/64 scope global dynamic 
       valid_lft 345642sec preferred_lft 345642sec
    inet6 fe80::d6be:d9ff:fefd:84fe/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 1c:3e:84:01:bf:86 brd ff:ff:ff:ff:ff:ff

答案1

编辑:我直接跳到了问题的结尾,没有注意到你一开始就试图用普通用户帐户登录。下面解释了为什么远程root登录在 Ubuntu 中默认不起作用。无论如何,它似乎有所帮助。

对于普通用户来说,只需查看/var/log/auth.log。它会准确地告诉您问题是什么,并且让您对需要做什么有一个相当清楚的了解。

但对于根本问题来说,存在一点障碍/etc/ssh/sshd_config

# Authentication:
LoginGraceTime 120
PermitRootLogin without-password
StrictModes yes

这是默认设置,这意味着它只允许 root 使用基于 SSH 密钥的身份验证。
它不允许您使用密码登录。

显然,你可以将设置更改为yes,但你开始破坏 Ubuntu 的安全性。拥有有效的 root 登录名(尤其是使用超级易破解的密码)通常是一个非常糟糕(且不必要的)的想法。使用 SSH 密钥会更简单。

相关内容