ubuntu 18.04安装ssh
时间: 2023-09-26 17:05:35 浏览: 158
在 Ubuntu 18.04 上安装 SSH 非常简单,只需要执行以下命令:
1. 打开终端
2. 输入以下命令安装 SSH:`sudo apt-get install openssh-server`
3. 等待安装完成后,SSH 服务会自动启动。
现在你可以使用 SSH 客户端连接到 Ubuntu 18.04 上了。
相关问题
ubuntu18.04无法ssh
Ubuntu 18.04无法SSH可能有多种原因导致,以下是一些常见的解决方法:
1. 确保SSH服务器已安装:在终端中运行以下命令来安装OpenSSH服务器:
```
sudo apt-get install openssh-server
```
2. 检查SSH服务是否正在运行:运行以下命令来检查SSH服务的状态:
```
sudo service ssh status
```
如果服务未运行,可以使用以下命令启动它:
```
sudo service ssh start
```
3. 检查防火墙设置:如果您的系统上启用了防火墙,确保允许SSH流量通过。默认情况下,SSH使用端口22。您可以使用以下命令检查防火墙规则:
```
sudo ufw status
```
如果防火墙未允许SSH流量,可以使用以下命令启用它:
```
sudo ufw allow ssh
```
4. 检查SSH配置文件:打开SSH配置文件`/etc/ssh/sshd_config`,确保以下行没有被注释掉:
```
Port 22
PermitRootLogin yes
```
5. 检查网络连接:确保您的Ubuntu系统与目标SSH服务器之间有网络连接,并且目标服务器的IP地址是正确的。
如果上述方法都无法解决问题,您可以尝试重新安装OpenSSH服务器或者查看系统日志以获取更多详细的错误信息。
ubuntu18.04离线安装ssh
### 回答1:
要在Ubuntu 18.04上离线安装SSH,您可以按照以下步骤操作:
1. 在另一台联网的计算机上下载SSH软件包及其所有依赖项。您可以使用以下命令将它们打包成一个tar文件:
```
sudo apt-get install openssh-server
sudo apt-get install openssh-client
sudo apt-get install ssh
sudo apt-get install sshpass
sudo apt-get install libssh2-1
sudo apt-get install libssh2-1-dev
sudo apt-get install libssh2-1-dbg
sudo apt-get install libssh2-1-doc
sudo apt-get install libssh2-1-test
sudo apt-get install libssh2-ocaml
sudo apt-get install libssh2-ocaml-dev
sudo apt-get install libssh-4
sudo apt-get install libssh-dev
sudo apt-get install libssh-doc
sudo apt-get install libssh-gcrypt-4
sudo apt-get install libssh-gcrypt-dev
sudo apt-get install libssh-gcrypt-doc
sudo apt-get install libssh-krb5-27
sudo apt-get install libssh-krb5-dev
sudo apt-get install libssh-krb5-doc
sudo apt-get install libssh-4-dbg
sudo apt-get install libssh-4-doc
sudo apt-get install libssh-4-dev
sudo apt-get install libssh-4-test
sudo apt-get install libssh-4-ocaml
sudo apt-get install libssh-4-ocaml-dev
sudo apt-get install libssh-4-ocaml-doc
sudo apt-get install libssh-4-ocaml-dbg
sudo apt-get install libssh-4-ocaml-test
sudo apt-get install libssh-4-ocaml-dev-doc
sudo apt-get install libssh-4-ocaml-dev-dbg
sudo apt-get install libssh-4-ocaml-dev-test
sudo apt-get install libssh-4-ocaml-dev-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-doc
sudo apt-get install libssh-4-ocaml-dev-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test
sudo apt-get install libssh-4-ocaml-dev-dbg-doc
sudo apt-get install libssh-4-ocaml-dev-test-dbg
sudo apt-get install libssh-4-ocaml-dev-dbg-doc
sudo apt-get install libssh-4-ocaml-dev-test-doc
sudo apt-get install libssh-4-ocaml-dev-test-dbg-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install libssh-4-ocaml-dev-dbg-test-doc
sudo apt-get install lib
### 回答2:
要在Ubuntu 18.04上进行离线安装SSH,您需要以下步骤:
1. 下载必要软件包:您需要下载OpenSSH Server软件包以及其所有依赖项(包括libcrypt1和libc6)。您可以在其他电脑上下载这些软件包,并将它们复制到目标Ubuntu机器上。
2. 安装必要软件包:请使用dpkg命令(例如“ sudo dpkg -i openssh-server_7.6p1-4ubuntu0.3_amd64.deb”)来将软件包安装到Ubuntu系统中。如果出现错误,请使用apt-get命令来解决依赖问题。
3. 配置SSH:打开/etc/ssh/sshd_config文件并进行所需的更改。您可以更改端口,禁用root登陆,启用公钥验证等等。更改完成后,请使用命令“ sudo systemctl restart ssh”重启SSH服务。
4. 测试SSH:通过使用另一台电脑或工具(例如Putty)连接到Ubuntu机器来测试SSH连接。如果连接成功,则您现在可以通过SSH实现Ubuntu 18.04的远程访问和管理。
总之,在Ubuntu 18.04上离线安装SSH并不特别困难,只需遵循上述步骤即可实现成功安装。由于安全问题,请确保安装并配置SSH时使用安全的密码策略和基本安全知识,以最大限度地保护您的系统。
### 回答3:
要在Ubuntu 18.04上离线安装SSH,您需要遵循以下步骤:
1.获取OpenSSH软件包:
您可以从官方Ubuntu软件包网站(https://packages.ubuntu.com/)或从其他Ubuntu软件包存储库下载OpenSSH软件包。最好选择与您的Ubuntu版本相匹配的OpenSSH软件包。您可以将软件包下载到本地系统或移动设备中。
2.在Ubuntu安装OpenSSH:
一旦您获得了OpenSSH软件包,您需要将其转移到Ubuntu系统中进行安装。如果您已经将软件包下载到本地系统中,在Ubuntu中打开终端并导航到软件包的目录。在那里,运行以下命令以安装OpenSSH:
sudo dpkg -i <openssh-package-name.deb>
这将安装OpenSSH并处理任何依赖项。请注意,如果OpenSSH需要其他软件包才能正常工作,则可能需要手动从其他Ubuntu存储库中获取这些软件包。
3.配置OpenSSH:
一旦OpenSSH安装完成,您需要在Ubuntu中配置它。打开终端并输入以下命令以在Ubuntu上配置OpenSSH:
sudo systemctl enable ssh
sudo systemctl start ssh
这将启用和启动SSH服务,并在Ubuntu开机时自动启动SSH服务。然后,您可以使用SSH客户端连接到Ubuntu系统。
总结:
通过遵循上述步骤,您可以在Ubuntu 18.04上离线安装和配置OpenSSH。这将允许您使用SSH客户端连接到Ubuntu系统并进行远程管理和文件传输。请注意,为了保持系统安全,您应该尽可能使用SSH密钥而不是密码进行身份验证。
阅读全文