Linux-ubuntu服务器SSH服务配置

防火墙关闭

CentOS-7

1.首先切换到 root:su -root
2.进入 /bin 目录:cd /bin
3.执行命令:systemctl stop firewalld.service(关闭防火墙)
systemctl disable firewalld.service(关闭防火墙自动启动)
4.查看防火墙状态:systemctl status firewalld.service(查看防火墙服务状态)

安装openssh-server

启动SSH服务

  • ubuntu ps -e | grep ssh
  • centos查看SSH是否安装,rpm -qa | grep ssh
  • 若没安装SSH则可输入:yum install openssh-server安装
  • 启动SSH服务:systemctl restart sshd
  • 启动服务:systemctl start sshd
  • 停止服务:systemctl stop sshd
  • 设置SSH服务为开机启动:systemctl enable sshd,systemctl disable sshd

markdown

  • <img src="你的图片链接地址" width="60%">
posted @ 2022-10-16 14:14  starc的miao  阅读(229)  评论(0)    收藏  举报