ubuntu16.04 安装ssh开机启动

ubuntu安装ssh并开机启动

1、安装openssh-server
sudo apt-get install openssh-server

启动
sudo service ssh start

查询服务启动状态:
sudo ps -e | grep ssh
或者
sudo service ssh status


2、开机自动启动ssh命令
sudo systemctl enable ssh
3、关闭ssh开机自动启动命令
sudo systemctl disable ssh
4、单次开启ssh
sudo systemctl start ssh
5、单次关闭ssh
sudo systemctl stop ssh
6、设置好后重启系统
reboot
7、查看ssh是否启动,看到Active: active (running)即表示成功
sudo systemctl status ssh

猜你喜欢

转载自blog.csdn.net/hyl999/article/details/108035692