分页: 1 / 1

Ubuntu16.04 SSH 登陆另一台电脑,输入密码错误

发表于 : 2018-01-04 13:16
quanbisen
我有两台的电脑,都安装了Ubuntu16.04,都用sudo apt install ssh安装了ssh,但是当我使用ssh IP登陆的时候(IP用ping测试没问题),要求输入密码,但是密码怎么输入都是提示Permission deny,please try again.首先,密码是正确的,我用密码可以解锁那台电脑,照着网上的教程,设置了root用户密码,再用sudo ssh IP 输入root的密码,登陆就成功了,想知道是什么原因导致普通用户无法远程登陆?我不想用root用户登陆操作,麻烦知道的大神告知一下我,我觉得Ubuntu16.04的密码存在bug,因为之前试过搞了哪个设置里的账户,设置了无密码,它就提示我密码登陆,然后怎么输入密码都是错误的,因为设置了无密码。

Re: Ubuntu16.04 SSH 登陆另一台电脑,输入密码错误

发表于 : 2018-01-04 13:52
poloshiao
我有两台的电脑,都安装了Ubuntu16.04,都用sudo apt install ssh安装了ssh
1. 參閱
https://help.ubuntu.com/16.04/servergui ... erver.html
SSH 是 Server-Client 機制
1-1. 一台是 OpenSSH Server
sudo apt install openssh-server
1-2. 另一台是 openssh-client
安裝 Ubuntu 時 已經預裝 套件 openssh-client
https://packages.ubuntu.com/xenial/openssh-client
套件: openssh-client (1:7.2p2-4ubuntu2.1 以及其他的) [security]

2. 如果在 openssh-client 產生一組 SSH Key
將其中一個
存進 open-server
則從 client 使用 ssh 連接 server 時 就不會再要你輸入密碼
2-1. 參閱
2-1-1. https://help.ubuntu.com/16.04/servergui ... enssh-keys
SSH Keys

Re: Ubuntu16.04 SSH 登陆另一台电脑,输入密码错误

发表于 : 2018-01-04 14:30
quanbisen
poloshiao 写了:
我有两台的电脑,都安装了Ubuntu16.04,都用sudo apt install ssh安装了ssh
1. 參閱
https://help.ubuntu.com/16.04/servergui ... erver.html
1-1. 一台是 OpenSSH Server
sudo apt install openssh-server
1-2. 另一台是 openssh-client
安裝 Ubuntu 時 已經預裝 套件 openssh-client
https://packages.ubuntu.com/xenial/openssh-client
套件: openssh-client (1:7.2p2-4ubuntu2.1 以及其他的) [security]

2. 如果在 openssh-client 產生一組 SSH Key
將其中一個
存進 open-server
則從 client 使用 ssh 連接 server 時 就不會再要你輸入密碼
2-1. 參閱
2-1-1. https://help.ubuntu.com/16.04/servergui ... enssh-keys
SSH Keys
你好,我这边不是想配置无密码登陆,我是想知道为什么我的普通用户的密码登陆不了,一直都说错误,我两台电脑如果用ssh 127.0.0.1(localhost)输入本机密码,都是可以登陆到的

Re: Ubuntu16.04 SSH 登陆另一台电脑,输入密码错误

发表于 : 2018-01-04 14:37
poloshiao
我有两台的电脑,都安装了Ubuntu16.04,都用sudo apt install ssh安装了ssh
1. https://packages.ubuntu.com/xenial/ssh
套件: ssh (1:7.2p2-4ubuntu2.1) [security]
其他與 ssh 有關的套件
dpkg (>= 1.17.5)
Debian package management system
openssh-client (>= 1:7.2p2-4ubuntu2.1)
secure shell (SSH) client, for secure access to remote machines
openssh-server (>= 1:7.2p2-4ubuntu2.1)
secure shell (SSH) server, for secure access from remote machines
1-1. 你安裝 ssh 表示兩台電腦都安裝了 openssh-clientopenssh-server
我两台电脑如果用ssh 127.0.0.1(localhost)输入本机密码,都是可以登陆到的
2. ssh 127.0.0.1
是登入本機 ?
2-1. 要登入 另一台電腦 (Server 端)
該電腦 (Server 端) 需要妥適設定 sshd_config
2-1-1. 參見
http://manpages.ubuntu.com/manpages/xen ... fig.5.html
sshd_config — OpenSSH SSH daemon configuration file
2-2. 在本機 (Client 端)
該電腦 (Client 端) 需要妥適設定 ssh_config
2-2-1. 參見
http://manpages.ubuntu.com/manpages/xen ... fig.5.html
ssh_config — OpenSSH SSH client configuration files
照着网上的教程,设置了root用户密码,再用sudo ssh IP 输入root的密码,登陆就成功了
我不想用root用户登陆操作
3. http://manpages.ubuntu.com/manpages/xen ... fig.5.html
sshd_config — OpenSSH SSH daemon configuration file
使用 PermitRootLogin 搜尋

4. 另一個新手常常忽略的問題是 防火牆
4-1. sudo cat /etc/services | grep ssh
ssh 22/tcp # SSH Remote Login Protocol
表示 ssh 通道是使用 port 22/tcp
4-2. 你要確認 port 22/tcp 沒有被防火牆阻擋進出

5. 進一步參閱 下述網頁 及其 連結網頁
https://help.ubuntu.com/community/SSH
SSH