1. 检查centos7是否安装了openssh-server

yum list installed | grep openssh-server

  1. 没有安装,执行yum安装

yum install openssh-server

  1. 如果已经安装

vim /etc/ssh/sshd_config

取消注释(去掉#)Port 22、PermitRootLogin(开启远程登陆) PasswordAuthentication(开启使用密码作为连接远征)


  1. 运行sshd服务

service sshd start

  1. 检查sshd服务状态

ps -e | grep sshd `或者 netstat -an | grep 22`

  1. 设置开机启动成功

systemctl enable sshd.service

注意:virtualbox下ifconfig看不到linux真正的ip,需要通过管理 –〉主机网络管理器查看

标签: 安装, server, yum, CentOS7, grep, SSH, sshd, openssh, Virtualbox

相关文章推荐

添加新评论,含*的栏目为必填