如何做网站挂qq,室内设计3d模型素材网站,网站建设 小程序,云服务器怎么搭建1#xff0c;首先#xff0c;需要从Docker官网获得centos或Ubuntu镜像 2#xff0c;当本地已有Ubuntu镜像后#xff08;大概200M左右大小#xff09;#xff0c;使用如下命令 [cpp]view plaincopy docker run -t -i ubuntu /bin/bash 即可启动一个容器#xff0c;并放…1首先需要从Docker官网获得centos或Ubuntu镜像 2当本地已有Ubuntu镜像后大概200M左右大小使用如下命令 [cpp]view plaincopy docker run -t -i ubuntu /bin/bash 即可启动一个容器并放入Ubuntu镜像3更新源, apt-get update
接着就可以使用 apt-get install openssh-client openssh-server 来安装openssh服务了
需要把此镜像保存一下 [cpp]view plaincopy docker commit [container-id] [image-id] 在把刚刚的container干掉 [cpp]view plaincopy docker stop [container-id] 嗯还需要将这个container删除掉 [csharp]view plaincopy docker rm [container-id] 最后加载刚刚保存到的最新的image放入到新的容器中去 [cpp]view plaincopy docker run --name [image-name] -i -t -p 50001:22 [image-id] 4启动openssh服务 [cpp]view plaincopy /etc/init.d/ssh start 5此时可以从其他机器登陆到这个docker容器里了 6可能出现一些错误使得一登陆进去就直接关闭连接了 [cpp]view plaincopy [rootWshare84 start_docker_sh]# ssh root10.10.2.84 -p 50001 The authenticity of host [10.10.2.84]:50001 ([10.10.2.84]:50001) cant be established. RSA key fingerprint is aa:05:84:4c:f2:15:f3:04:89:9c:04:33:0d:15:14:1f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added [10.10.2.84]:50001 (RSA) to the list of known hosts. root10.10.2.84s password: Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 2.6.32-431.el6.x86_64 x86_64) * Documentation: https://help.ubuntu.com/ Last login: Wed Jan 21 01:25:17 2015 from 172.17.42.1 Connection to 10.10.2.84 closed. 此时解决方案 [cpp]view plaincopy ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key [cpp]view plaincopy echo root:yourpasswd | chpasswd //设置root密码 [cpp]view plaincopy vi /etc/ssh/sshd_config 将PermitRootLogin 改为 yes将 UsePAM 改为 no。重启服务 [cpp]view plaincopy /etc/init.d/ssh restart