linux docker安装openssh

2024-01-25 23:35:42
/
0 点赞
/
75 阅读
2024-01-25

安装ssh服务

apt-get update
apt-get install openssh-server

apt-get install vim

设置SSH登录密码,默认密码9r2F0K$@fi6INWT8%*

passwd

修改配置文件

修改#PermitRootLogin prohibit-password -> PermitRootLogin yes

vim /etc/ssh/sshd_config

#PermitRootLogin prohibit-password
PermitRootLogin yes
PasswordAuthentication yes

重启ssh

service ssh restart

开启免密登录

ssh-copy-id -i  ~/.ssh/id_ed25519.pub  id_rsa.pub root@server.ip
版权属于:

那棵树看起来生气了

本文链接:

https://dengyb.com/archives/27.html(转载时请注明本文出处及文章链接)