Ubuntu开启ssh访问-虚拟机开启ssh访问方法
1.安装
-
安装ssh服务器
sudo apt install openssh-server
-
安装ssh客户端
sudo apt install openssh-client
2.配置
-
配置ssh客户端, 去掉PasswordAuthentication yes前面的#, 保存退出.因为#是注释
sudo vim /etc/ssh/ssh_config
-
配置ssh服务器, 把PermitRootLogin prohibt-password修改为PermitRootLogin yes, 保存退出, 如果前面有#, 同样去掉#
sudo vim /etc/ssh/sshd_config
3.启动
-
重启ssh服务器
sudo /etc/init.d/ssh restart
-
查看ip地址, 在远程机器上填写ip地址和端口22以及登录用户名
sudo ifconfig