SSH连接Virtualbox CentOS7
-
检查centos7是否安装了openssh-server
yum list installed | grep openssh-server -
没有安装,执行yum安装
yum install openssh-server -
如果已经安装
vim /etc/ssh/sshd_config
取消注释(去掉#)
Port 22
PermitRootLogin(开启远程登陆)
PasswordAuthentication(开启使用密码作为连接远征) -
运行sshd服务
service sshd start -
检查sshd服务状态
ps -e | grep sshd 或者 netstat -an | grep 22 -
设置开机启动成功
systemctl enable sshd.service
注意:virtualbox下ifconfig看不到linux真正的ip,需要通过管理 –〉主机网络管理器 查看