Skip to content

Instantly share code, notes, and snippets.

@nanmi
Last active June 30, 2023 02:29
Show Gist options
  • Save nanmi/fda43aa5033ee4bc7ce711fa217271d4 to your computer and use it in GitHub Desktop.
Save nanmi/fda43aa5033ee4bc7ce711fa217271d4 to your computer and use it in GitHub Desktop.
SSH connect to docker container

Docker容器ssh远程连接

1.Ubuntu 版本

安装ssh
apt update
apt install openssh-server
/etc/init.d/ssh start
修改ssh配置文件
vim /etc/ssh/sshd_config

# 修改PasswordAuthentication yes
# 修改PermitRootLogin yes
重启ssh服务
/etc/init.d/ssh restart
设置root密码
passwd root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment