ssh
- ssh debug
# ssh -vvv username@host
- 运行远程命令
# ssh username@host 'cat /etc/issue'
Ubuntu 19.04 \n \l
# ssh -t root@66.42.56.193 'top' #交互式shell
- ssh隧道
# ssh -C -N -f -L 127.0.0.1:7001:127.0.0.1:3128 username@host
- 远程拷贝文件
# scp [user@]host:[path] . #从服务上下载
# scp filename [user@]host:[path] # 上传文件到服务器
- 生成新的公私密钥对
# ssh-keygen - ubuntu18.04 ssh自定义登录提示信息
# vi /etc/motd
- SOCKS server, 端口号为8888,可以替换成其他端口
# ssh -N -D 127.0.0.1:8888 root@your_vps_host
参考资料
https://www.ibm.com/developerworks/cn/linux/l-cn-sshforward/ https://wiki.ubuntu.com/UpdateMotd#Design