环境
1、mac操作系统
2、virtualbox+centos7虚拟系统
虚拟机网络配置
1、界面名称:桥接网卡
2、控制芯片:准虚拟化网络
3、混杂模式:全部允许
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/79fa5e211e72e232b6fc8cbbe09e7e8f.png)
查看虚拟机ip
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/94974286e1b43ed193a8722793a49db0.png)
mac iTerm2中操作
1、生成ssh密钥(之前已经生成过,此步骤就不再覆盖了)
ssh-keygen
2、将生成的公钥发送到centos虚拟机中
ssh-copy-id -i .ssh/id_rsa.pub 用户名字@192.168.x.xxx
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/4587d4b4719c4fb2d6fdb1a8dd475dcc.png)
最终测试
liweideMacBook-Pro:~ liwei$