我有两台的电脑,都安装了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-client 及
openssh-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