【VsCode】SSH设置免密登录
近来在服务器配置上花了大量时间,配置免密登录是其中一个绕不开的主题,故在此记录
1.免密登录
- 在服务器上生成id_rsa
ssh-keygen -m PEM -t rsa
-m:format, -t:加密算法

- 在~/.ssh下
cat id_rsa.pub >> authorized_keys

- 将生成的id_rsa下载到本地

- 修改本地ssh的config
在对应设置后添加
IdentityFile "id_rsa文件路径"

2.其他问题
有次在登录华为云ECS时遇到报错
channel 3: open failed: administratively prohibited: open failed
channel 4: open failed: administratively prohibited: open failed
解决方案:
vim /etc/ssh/sshd_config
将# AllowTcpForwarding yes 取消注释,改成yes后重启sshd服务
systemctl restart sshd
暂时先记录这两个问题,后面想到再补充

浙公网安备 33010602011771号