• 最小安装centos8
在安装页面启用了网络连接, 然后安装好了后就直接进入了系统
  • 无法使用ifconfig命令
yum install net-tools -y
  • 无法使用ssh客户端连接
yum install openssh-server -y
安装好了后配置一下
vi /etc/ssh/sshd_config
把其中的 #Port 22 前面的 # 去掉
默认是允许root远程登录的, 如果需要关闭, PermitRootLogin yes 把其中的yes改为no即可
执行 /bin/systemctl start sshd.service 开启ssh服务, 这个命令没有回显

检查ssh服务是否开启
[root@localhost ~]# ps -e | grep sshd
 1223 ?        00:00:00 sshd
 2168 ?        00:00:00 sshd
 2172 ?        00:00:00 sshd

检查22号端口是否开启
[root@localhost ~]# netstat -an | grep 22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0     52 192.168.56.102:22       192.168.56.1:4777       ESTABLISHED
tcp6       0      0 :::22                   :::*                    LISTEN     

我这边测试默认好像是开机启动这个服务的, 如果没有开机自启
systemctl enable sshd.service

标签: none

添加新评论