-wei

1、先确定虚拟机是否装了openssh-server,执行 yum list installed |grep openssh-server 查看是否安装

这里显示已经安装,如果没有任何输出表示没有安装 , 执行 yum install openssh-server 命令安装

2、确定安装之后修改配置文件 vim /etc/ssh/sshd_config 

开启端口

 允许root用户登录

开启用户名密码验证登录

 保存退出

3、开启服务

systemctl start sshd.service

4、查看服务状态

systemctl status sshd.service

这里是已启动,查看端口监听状态 netstat -lnpt |grep 22 

5、连接

先使用命令 ifconfig 查看当前ip地址,出现 command not found 使用 yum -y install net-tools 安装

这里用的是Xshell

 

 

6、其他操作命令

systemctl enable sshd.service      #设置开机自启
systemctl stop sshd.service        #停止
systemctl restart sshd.service     #重启

分类:

技术点:

相关文章:

  • 2021-11-14
  • 2021-11-13
  • 2021-09-08
  • 2022-01-06
  • 2021-12-20
  • 2021-07-15
  • 2021-12-02
猜你喜欢
  • 2022-01-05
  • 2021-07-26
  • 2022-01-05
相关资源
相似解决方案