之前一些教程连接之后发现,还是连接不成功,个人认为是ip的问题。后面发现要把虚拟机的ssh打开
查询虚拟机ip
用户名@ubuntu:~$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.152.128 netmask 255.255.255.0 broadcast 192.168.152.255
inet6 fe80::f5e9:94e6:6650:5040 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:9d:80:e9 txqueuelen 1000 (Ethernet)
RX packets 536584 bytes 779853765 (779.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 79092 bytes 5398022 (5.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2894 bytes 663942 (663.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2894 bytes 663942 (663.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
打开虚拟机ssh
liqi@ubuntu:~$ sudo apt-get install -y openssh-server
liqi@ubuntu:~$ sudo /etc/init.d/ssh start
[ ok ] Starting ssh (via systemctl): ssh.service.
liqi@ubuntu:~$ ps -e|grep ssh
4437 ? 00:00:00 ssh-agent
9118 ? 00:00:00 sshd
此方法参照
进行连接
按照常规的方法进行连接:
https://blog.csdn.net/qq_46429858/article/details/109470423