Centos8开启SSH服务
- 检测是否安装 openssh-server ,输入命令
yum list installed | grep openssh-server
没有任何输出,表示没有安装
输入安装命令yum install openssh-server
- 使用 vim 打开 sshd 服务配置文件,输入命令
vim /etc/ssh/sshd_config
将第17,19,20行前的#号去掉 - 开启 sshd 服务,输入命令
sudo service sshd start
检测 sshd服务是否开启ps -e | grep sshd
检测 22 号端口是否开启netstat -an | grep 22
将 sshd 服务设置为开机自启动systemctl enable sshd.service
检测是否开启systemctl list-unit-files | grep sshd - 查看 Centos8 ip 命令
ifconfig
发现ip为:***.***.150.129 - 在主机中使用ping命令,测试是否可以连通Centos服务器
- 使用SSH工具登录服务器(XShell工具有些有后门)这里推荐大家使用Putty登录。
端口为第二步中的 Port 默认为22
点击 open 后会出现一个 命令框
密码在输入时是不显示的