Public Repository

Last pushed: 10 months ago
Short Description
Short description is empty for this repo.
Full Description

Full description is empty for this repo.

Docker Pull Command
Owner
tjtjob

Comments (1)
tjtjob
10 months ago

==============centos7 镜像文件=========
docker pull centos:7
docker run -i -t centos:7 /bin/bash
yum install passwd openssl openssh-server -y
启动sshd:
/usr/sbin/sshd -D
UsePAM yes 改为 UsePAM no
UsePrivilegeSeparation sandbox 改为 UsePrivilegeSeparation no
[root@b5926410fe60 /]# sed -i "s/#UsePrivilegeSeparation./UsePrivilegeSeparation no/g" /etc/ssh/sshd_config
[root@b5926410fe60 /]# sed -i "s/UsePAM.
/UsePAM no/g" /etc/ssh/sshd_config

修改完后,重新启动sshd
[root@b5926410fe60 /]# /usr/sbin/sshd -D
[root@b5926410fe60 /]# passwd root (输入密码为:654321)

docker commit b5926410fe60 tjtjob/centos7-ssh #在系统中提交当前镜像为tjtjob/centos7-ssh

运行命令如下:
docker run -d -p 10022:22 tjtjob/centos7-ssh:latest /usr/sbin/sshd -D