💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ### 进入docker容器 ***** 镜像使用官方censo:7 ``` docker run -itd -p 2222:22 --privileged=true --name c7:latest centos:7 /sbin/init ``` >使用--privileged=true 和/sbin/init 是为了可以在容器中使用systemctl命令 进入docker容器 ``` docker exec -it c7 /bin/bash ``` ### 下载openssl-server(其他的安装包可以省略) ``` yum install -y net-tools \ libgomp.x86_64 \ libtool-ltdl-devel.x86_64 \ psmisc.x86_64 \ gdb \ gd \ openssh-server ``` ### 配置sshd_config ***** 进入/etc/ssh/sshd_config配置文件 ``` vi /etc/ssh/sshd_config ``` 取消注释: ``` PermitRootLogin yes ``` 给root账户设置密码: ``` /bin/echo 'root:123456'|chpasswd ``` 重启服务 ``` systemctl restart sshd ``` ### 验证是否成功 ``` ssh root@宿主机ip 2222 ``` ### 提交容器为一个新镜像 ``` docker commit -m "ssh" comtain_id name ```