yun -y install openssh-server //默认系统是安装过的,没安装的进行安装
vi /etc/ssh/sshd_config //编辑ssh配置文件
Port 22 //去掉文件#Port 22前#号
PermitRootLogin yes //去掉文件#PermitRootLogin yes前#号,使root能登录
systemctl start sshd.service //启动ssh
systemctl enable sshd.service //开机启动ssh
systemctl status sshd.service //显示ssh配置状态
//其它,每次修改配置文件需重启ssh生效
systemctl stop sshd.service //停止ssh
systemctl restart sshd.service //停止ssh
systemctl disable sshd.service //开机停止启动ssh