ubuntu安装ssh并开机启动

1、安装openssh-server
sudo apt-get install openssh-server
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

你可能感兴趣的:(ubuntu安装ssh并开机启动)