mac本地连接虚拟机
2020-09-02 本文已影响0人
轻云绿原
1:打开虚拟机查看一下IP
ifconfig
[panpengfei@localhost tmp]$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.211.55.3 netmask 255.255.255.0 broadcast 10.211.55.255
inet6 fe80::21c:42ff:fe91:4e80 prefixlen 64 scopeid 0x20<link>
inet6 fdb2:2c26:f4e4:0:21c:42ff:fe91:4e80 prefixlen 64 scopeid 0x0<global>
ether 00:1c:42:91:4e:80 txqueuelen 1000 (Ethernet)
RX packets 109897 bytes 148141979 (141.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 54911 bytes 3750826 (3.5 MiB)
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 2484 bytes 210736 (205.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2484 bytes 210736 (205.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:e0:3b:e2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
找出IP地址
10.211.55.3
2:连接
在Termianls
里输入
ssh 10.211.55.3
或
ssh root@10.211.55.3
输出
The authenticity of host '10.211.55.3 (10.211.55.3)' can't be established.
ECDSA key fingerprint is SHA256:fJ6k6sw4fnCo3JEpsTMW95PvAf1Bqi2JslamUpxk3Ns.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
输入yes
yes
询问密码
Warning: Permanently added '10.211.55.3' (ECDSA) to the list of known hosts.
panpengfei@10.211.55.3's password:
3:登录成功
4:登出
第一种:快捷键->ctrl+d
第二种:命令行->logout