[ubuntu] ssh登录docker
进入容器后
# install ssh
$ apt-get install openssh-client
$ apt-get install openssh-server# start ssh service
$ /etc/init.d/ssh start
* Starting OpenBSD Secure Shell server sshd[ OK ] # enable root login
$ vim /etc/ssh/sshd_config#------------ in file sshd_config -------------#
# "PermitRootLogin yes" needs adding
...
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
...
#---------- end of file sshd_config -----------## restart service
$ service ssh restart
* Restarting OpenBSD Secure Shell server sshd[ OK ] # set password of user root
$ passwd root# add port to ssh
$ /usr/sbin/sshd -p 12345# checkout ip
$ apt-get install net-tools
$ ifconfig
【[ubuntu] ssh登录docker】在其他地方连接
$ ssh root@{ip got above} -p 12345
推荐阅读
- SSH|SSH 免密
- ssh生成公钥秘钥
- VM|VM ware 的 harbor 私有仓库搭建 (Ubuntu16.04)
- Xshell5|Xshell5 远程连接本地虚拟机Ubuntu16
- 为Google|为Google Cloud配置深度学习环境(CUDA、cuDNN、Tensorflow2、VScode远程ssh等)
- 运维|如何限制IP 通过 SSH连接服务器
- 运维|Linux 禁止用户或 IP通过 SSH 登录
- ubuntu开机默认进入命令行模式/用户图形界面
- seedubuntu|seedubuntu 下搭建discuz论坛
- Ubuntu|Ubuntu 16.04(LTS)---- 系统安装(1)