网站分析百度长沙租房网
登陆容器之后修改密码:
passwd 
密码设置完成后安装openssh-server
apt-get install openssh-server 
修改端口号为50022并添加配置
vim /etc/ssh/sshd_config 
修改成
Port 50022
PasswordAuthentication yes
PermitRootLogin yes 
启动
root@linux:~# /etc/init.d/ssh start
[ ok ] Starting OpenBSD Secure Shell server: sshd. 
查看
root@linux:~# /etc/init.d/ssh status
[ ok ] sshd is running. 
--net修改.bashrc,运行容器后就启动ssh
在最后面添加:
/etc/init.d/ssh start 
保存镜像
启动时注--net=host这样就可以用50022登陆了
docker run --net=host -it 容器名 /bin/bash 
最终在宿主机可见:

50022端口已被占用

