ssh】 ssh远程连接工具【linux】


通过pem文件(通常需要0600的权限)进行

ssh -i /path/to/file.pem user@example.com

在一个非标准的端口上连接。

ssh -p 2222 user@example.com

连接和转发认证代理

ssh -A user@example.com

在一个远程服务器上执行一个命令

ssh -t user@example.com 'the-remote-command'

在SSH上建立一个X会话隧道:

ssh -X user@example.com

使用本地主机(端口8080)和远程主机(remote.example.com:5000)之间的隧道通过代理(personal.server.com)重定向流量

ssh -f -L 8080:remote.example.com:5000 user@personal.server.com -N

要通过SSH启动一个特定的X应用程序

ssh -X -t user@example.com 'chromium-browser'

要在localhost和9999端口上创建一个SOCKS代理

ssh -D 9999 user@example.com

-X使用一个xsession,-C压缩数据,"-c blowfish "使用加密blowfish

ssh user@example.com -C -c blowfish -X

更多信息可以参见:

http:unix.stackexchange.com/q/12755/44856

当没有rsync命令可用时,通过ssh从远程主机复制文件和文件夹到pwd,并使用tar.gz压缩。

ssh user@example.com "cd /var/www/Shared/; tar zcf - asset1 asset2" | tar zxf -

通过SSH装载文件夹/文件系统

从https:github.com/libfuse/sshfs安装SSHFS

将允许您通过网络安全地装载文件夹

sshfs name@server:/path/to/folder /path/to/mount/point

Emacs可以通过SSH读取文件

文档: http:www.gnu.org/software/emacs/manual/html_node/emacs/Remote-Files.html

emacs /ssh:name@server:/path/to/file

ssh】 【linux】


To ssh via pem file (which normally needs 0600 permissions):

ssh -i /path/to/file.pem user@example.com

To connect on an non-standard port:

ssh -p 2222 user@example.com

To connect and forward the authentication agent

ssh -A user@example.com

To execute a command on a remote server:

ssh -t user@example.com 'the-remote-command'

To tunnel an x session over SSH:

ssh -X user@example.com

Redirect traffic with a tunnel between local host (port 8080) and a remote

host (remote.example.com:5000) through a proxy (personal.server.com):

ssh -f -L 8080:remote.example.com:5000 user@personal.server.com -N

To launch a specific x application over SSH:

ssh -X -t user@example.com 'chromium-browser'

To create a SOCKS proxy on localhost and port 9999

ssh -D 9999 user@example.com

-X use an xsession, -C compress data, "-c blowfish" use the encryption blowfish

ssh user@example.com -C -c blowfish -X

For more information, see:

http:unix.stackexchange.com/q/12755/44856

Copy files and folders through ssh from remote host to pwd with tar.gz compression

when there is no rsync command available

ssh user@example.com "cd /var/www/Shared/; tar zcf - asset1 asset2" | tar zxf -

Mount folder/filesystem through SSH

Install SSHFS from https:github.com/libfuse/sshfs

Will allow you to mount a folder securely over a network.

sshfs name@server:/path/to/folder /path/to/mount/point

Emacs can read file through SSH

Doc: http:www.gnu.org/software/emacs/manual/html_node/emacs/Remote-Files.html

emacs /ssh:name@server:/path/to/file


腾图小抄 SCWY.net v0.03 小抄561条 自2022-01-02访问368508次