>>cd /etc/sysconfig/network-scripts
>>vim vim ifcfg-eth0

>>ifconfig

>>vim /etc/udev/rules.d/70-persistent-net.rules

>>service network restart
下面讲一下如何ssh到virtual box里的centos
登陆到centos里,安装sshd
>>sudo apt-get install openssh-server
>>ps -ef | grep ssh

配置端口转发规则

在mac os的命令行里执行如下操作
>>ssh -p 2222 root@127.0.0.1
下面讲第二种从mac连接到virtual box centos的方式
本文详细介绍如何在VirtualBox中设置并使用SSH服务,实现从MacOS远程连接至CentOS虚拟机。首先,在CentOS中安装openssh-server,通过查看进程确认安装成功。接着,配置端口转发规则,允许外部通过指定端口访问SSH服务。最后,通过在MacOS终端执行SSH命令,使用指定端口完成远程连接。

1万+

被折叠的 条评论
为什么被折叠?



