-
基本操作
docker run -it -p 2222:22 ubuntu /bin/bash apt-get update apt-get install ssh ssh-keygen vim authorized_keys
-
配置ssh
vim /etc/ssh/sshd_config
PermitRootLogin yes AuthorizedKeysFile /root/.ssh/authorized_keys PasswordAuthentication no
-
启动sshd
service ssh start
-
ssh连接
ssh root@localhost -p 2222
网友评论