查看是否已安装openssh-server
yum list installed | grep openssh-server
未安装的话 使用yum install openssh-server 进行安装即可
修改配置文件
配置文件路径:/etc/ssh/sshd_config
Port 22
ListenAddress 0.0.0.0
ListenAddress ::
PermitRootLogin yes
查看sshd 是否已经开机启动
systemctl list-unit-files|grep sshd
设置sshd.service 开机启动
systemctl enable sshd.service
取消sshd.service 开机启动
systemctl disable sshd.service
查看某服务的状态
systemctl status sshd.service
拓展总结:
开机启动命令 sytemctl enable httpd.service
取消开机启动 systemctl disable httpd.service
查看服务状态 systemctl status httpd.service