ubuntu上安装ssh
时间: 2023-12-11 09:32:35 浏览: 89
ubuntu安装ssh服务.pdf
以下是在Ubuntu上安装ssh的步骤:
1. 打开终端并更新软件包列表:
```shell
sudo apt update
```
2. 安装openssh-server:
```shell
sudo apt install openssh-server
```
3. 检查ssh服务是否正在运行:
```shell
sudo systemctl status ssh
```
如果ssh服务正在运行,您将看到以下输出:
```
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-08-23 14:22:22 CST; 1 weeks 0 days ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 1234 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 1235 (sshd)
Tasks: 1 (limit: 4915)
Memory: 2.1M
CGroup: /system.slice/ssh.service
└─1235 /usr/sbin/sshd -D
```
如果ssh服务未运行,则可以使用以下命令启动它:
```shell
sudo systemctl start ssh
```
4. 如果您想在系统启动时自动启动ssh服务,请使用以下命令:
```shell
sudo systemctl enable ssh
```
阅读全文