1.第一件事情,互ping,若都能ping通,则没有问题。
2.在虚拟机中的linux 终端 输入 ssh localhost
3.若出现
ssh: connect to hostlocalhost port 22: Connection refused
则表示没呀安装ssh 反之则直接启动
4.安装 命令如下
sudo apt-get install –y openssh-server
5.启动 命令如下
service ssh start
6.检查 命令如下
ps –e | grep ssh
若出现 : 6455 ? 00:00:00 sshd 则表示端口已经ok 启动成功
7.你可以通过 ssh 远程连接了
// xx.xx.xxx.xx 这是服务器的公网ip -p 后面是 端口 默认 22 ssh root@xx.xx.xxx.xx -p 22