ssh常用命令总结

知识的领域是无限的,我们的学习也是无限期的。这篇文章主要讲述ssh常用命令总结相关的知识,希望能为你提供帮助。
简单用法

> ssh rumenz.com rumenz@rumenz.com\'s password:

指定用户名登录
方法一
> ssh -l rumenz rumenz.com

方法二
> ssh rumenz@rumenz.com

指定端口登录登录
> ssh rumenz@rumenz.com -p 1234

修改SSH的默认端口
> vim /etc/ssh/ssh_config Port 1234//重启ssh > systemctl restart sshd.service

对所有数据请求压缩
> ssh -C rumenz@rumenz.com

打开调试模式
> ssh -v rumenz@rumenz.comOpenSSH_7.9p1, LibreSSL 2.7.3 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 48: Applying options for * debug1: Connecting to rumenz.com port 22. debug1: Connection established. debug1: identity file /Users/mac/.ssh/id_rsa type 0 debug1: identity file /Users/mac/.ssh/id_rsa-cert type -1 debug1: identity file /Users/mac/.ssh/id_dsa type -1 debug1: identity file /Users/mac/.ssh/id_dsa-cert type -1 debug1: identity file /Users/mac/.ssh/id_ecdsa type -1 debug1: identity file /Users/mac/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/mac/.ssh/id_ed25519 type -1 debug1: identity file /Users/mac/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/mac/.ssh/id_xmss type -1 debug1: identity file /Users/mac/.ssh/id_xmss-cert type -1 ...

绑定源地址
> ssh -b 1.2.3.4 rumenz@rumenz.com

远程执行命令
> ssh rumenz@rumenz.com ls -l

挂载远程文件系统
> sshfs -o idmap=user user@hostname:/home/user ~/Remote

> sshfs -o idmap=user rumenz@rumenz.com:/home/pi ~/rumenz

【ssh常用命令总结】原文链接:https://rumenz.com/rumenbiji/ssh-common-commands.html
微信公众号:入门小站

    推荐阅读