linux ssh 连接命令记录

linux ssh 连接命令记录

Linux SSH连接命令记录

在Linux系统中,SSH是一种远程连接协议,可以通过SSH连接到远程服务器进行操作。下面是一些常用的SSH连接命令记录:

1. 使用用户名和密码连接到远程服务器:

```bash

ssh username@hostname

```

2. 指定端口号连接到远程服务器:

ssh -p port username@hostname

3. 使用密钥对连接到远程服务器:

ssh -i /path/to/private_key username@hostname

4. 后台运行SSH连接:

ssh -f username@hostname

5. 指定本地端口转发到远程服务器:

ssh -L local_port:remote_host:remote_port username@hostname

通过以上命令,可以方便地进行SSH连接和操作远程服务器,提高工作效率和安全性。

 1  2  3  4  5  6  7  8  9  10