Linux学习笔记二:Ubuntu安装SSH(Secure Shell)服务

时间:2023-03-09 07:39:59
Linux学习笔记二:Ubuntu安装SSH(Secure Shell)服务

Ubuntu默认是没有安装SSH(Secure Shell)服务,如果想要通过ssh链接到Ubuntu,我们需要手动安装ssh-server。

SSH分客户端ssh-client,服务端ssh-server。

1.判断服务器是否安装ssh服务,可以用如下命令
 ssh localhost
ssh: connect to host localhost port 22: Connection refused  //这个表示还没有安装ssh服务

2.安装命令
sudo apt-get install openssh-server

3.卸载命令
sudo apt-get remove openssh-server

4.检查ssh-server是否正常安装
ps -e | grep ssh
6566 ?        00:00:00 sshd

5.如果没有则可以这样启动:
sudo /etc/init.d/ssh start 或者 service ssh start