openssh-client, 服务端需手动安装 sudo apt-get install openssh-server;ssh,服务进程名sshd/etc/ssh/sshd_config; 客户端配置文件 /etc/ssh/ssh_configssh-keygen -t rsa~/.ssh/authorized_keys文件里, 或在客户端使用命令:ssh-copy-id -i ~/.ssh/id_rsa.pub username@hostip
/etc/ssh/sshd_config,设置此项为no PasswordAuthentication no
sshd 服务cat /run/motd.dynamic. sudo apt install figlet toilet,再编辑/etc/update-motd.d/00-header, 添加 toilet -f standard -F metal oakfire。-vvvv 开启日志的ssh 中可见 debug1: send_pubkey_test: no mutual signature algorithm
, 解决办法是用 ed25519 来生成公私钥
ssh-keygen -t ed25519 -C "your_email@example.com"
ssh_config 开启选项 ForwardAgentssh-agent 在运行,并有 key , 可用 ssh-add -L检查, 如果没有,则添加 ssh-add yourkeysshd_config开启选项AllowAgentForwardingssh -A example.com 来手动 agent forwarding; Host example.com
ForwardAgent yes
ssh-add这一步时会提示一个错误(忘了叫什么),stackoverflow 有个高票解答能解决此问题: 执行eval `ssh-agent -s`
ssh -C -f -N -g -L listen_port:DST_Host:DST_port user@Tunnel_Host ssh -C -f -N -g -R listen_port:DST_Host:DST_port user@Tunnel_Host ssh -C -f -N -g -D listen_port user@Tunnel_Host
C:\Users\<username>\.ssh\config 文件,添加 Host <host>
ProxyCommand connect -S 127.0.0.1:1080 %h %p
其中 <host> 可为 * 表示不限目标ip, 或者可设置为特定的 ip 或域名,比如 github.com; 第二行的127.0.0.1:1080 可改为实际代理地址; connect为git mingw64自带, 所以在git bash 里可用, 如果没有则需要自行下载 connect.exe 放到 PATH 路径。
~/.ssh/config, 添加Host <host>
ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p
ssh <user>@<host> -o “ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p”# 生成 RSA 私钥(传统格式的) openssl genrsa -out rsa_private_key.pem 1024 # 生成 RSA 公钥 openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem # 将传统格式的私钥转换成 PKCS#8 格式的 openssl pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt