Ubuntu在需要远程登录的设备中安装ssh-server
sudo apt update
sudo apt install openssh-server
出现提示时,输入密码,然后按Enter继续安装。安装完毕后,使用以下命令来判断SSH服务是否运行:
sudo systemctl status ssh
手动启动
/etc/init.d/ssh start
配置SSH
sudo vim /etc/ssh/sshd_config
停止SSH
sudo systemctl disable --now ssh
重启SSH
sudo systemctl enable --now ssh