https://hub.docker.com/r/beli/sshd


docker run -d   -p 21198:22  --name ssh  --restart=always  -e TZ='Asia/Shanghai'   --ulimit nofile=262144:262144  -v /etc/localtime:/etc/localtime:ro -v /data/file:/data/file -v /data/opt/app/home:/data/opt/app/home -e  ROOT_PASSWORD='bMV44DN4tCZ6ydSQ'  -v /data/site/docker/env/tools/sshd/sshd_config_sshd:/etc/ssh/sshd_config:ro     -v /data/site/docker/env/tools/sshd/group_sshd:/etc/group:ro  -v /data/site/docker/env/tools/sshd/passwd_sshd:/etc/passwd:ro  -v  /data/site/docker/env/tools/sshd/shadow_sshd:/etc/shadow:ro  -w /data/opt/app/home    hub.htmltoo.com:5000/tools:sshd


docker run -d   -p 21199:22  --name sshd  --restart=always  -e TZ='Asia/Shanghai'   --ulimit nofile=262144:262144  -v /etc/localtime:/etc/localtime:ro -v /data/file:/data/file   -v /data/opt/app/home:/data/opt/app/home -e  ROOT_PASSWORD='bMV44DN4tCZ6ydSQ'  -v /data/site/docker/env/tools/sshd/sshd_config_sshd:/etc/ssh/sshd_config:ro  -w /data/opt/app/home  beli/sshd

groupadd  opt

useradd -d /data/opt/app  -g  opt  -m app -s /bin/bash

passwd  app

userdel -rf  app

-root

bMV44DN4tCZ6ydSQ

-app

JpuJ6VWBsMe2QNVJ

docker commit -m="update" -a="htmltoo.com" sshd  hub.htmltoo.com:5000/tools:sshd

docker push hub.htmltoo.com:5000/tools:sshd

docker cp sshd:/etc/group /data/site/docker/env/tools/sshd/group_sshd

docker cp sshd:/etc/passwd  /data/site/docker/env/tools/sshd/passwd_sshd

docker cp sshd:/etc/shadow /data/site/docker/env/tools/sshd/shadow_sshd

chmod -R 777  /data/site/docker/env/tools/sshd/


vim  /data/site/docker/env/tools/sshd/sshd_config_sshd

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.
Include /etc/ssh/sshd_config.d/*.conf
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
PubkeyAuthentication no
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile	.ssh/authorized_keys .ssh/authorized_keys2
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
KbdInteractiveAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the KbdInteractiveAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via KbdInteractiveAuthentication may bypass
# the setting of "PermitRootLogin prohibit-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and KbdInteractiveAuthentication to 'no'.
UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 600
#ClientAliveCountMax 3
#UseDNS no
#PidFile /run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
# override default of no subsystems
#Subsystem	sftp	/usr/lib/openssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
#	X11Forwarding no
#	AllowTcpForwarding no
#	PermitTTY no
#	ForceCommand cvs server

vim  /data/site/docker/env/tools/sshd/group_sshd

root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:
fax:x:21:
voice:x:22:
cdrom:x:24:
floppy:x:25:
tape:x:26:
sudo:x:27:
audio:x:29:
dip:x:30:
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
shadow:x:42:
utmp:x:43:
video:x:44:
sasl:x:45:
plugdev:x:46:
staff:x:50:
games:x:60:
users:x:100:
nogroup:x:65534:
tcpdump:x:101:
iperf3:x:102:
_ssh:x:103:
opt:x:1000:

vim  /data/site/docker/env/tools/sshd/passwd_sshd

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
_apt:x:42:65534::/nonexistent:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
tcpdump:x:100:101::/nonexistent:/usr/sbin/nologin
iperf3:x:101:102::/nonexistent:/usr/sbin/nologin
sshd:x:102:65534::/run/sshd:/usr/sbin/nologin
app:x:1000:1000::/data/opt/app/home:/bin/bash

vim  /data/site/docker/env/tools/sshd/shadow_sshd

root:$y$j9T$ktlMhyRu6m4ZJhhDKweWa0$y2LR4Uvlg6PuTMqkyMKaV97x/vidaBMBBzPMNyS2s55:19644:0:99999:7:::
daemon:*:19619:0:99999:7:::
bin:*:19619:0:99999:7:::
sys:*:19619:0:99999:7:::
sync:*:19619:0:99999:7:::
games:*:19619:0:99999:7:::
man:*:19619:0:99999:7:::
lp:*:19619:0:99999:7:::
mail:*:19619:0:99999:7:::
news:*:19619:0:99999:7:::
uucp:*:19619:0:99999:7:::
proxy:*:19619:0:99999:7:::
www-data:*:19619:0:99999:7:::
backup:*:19619:0:99999:7:::
list:*:19619:0:99999:7:::
irc:*:19619:0:99999:7:::
_apt:*:19619:0:99999:7:::
nobody:*:19619:0:99999:7:::
tcpdump:!:19640::::::
iperf3:!:19640::::::
sshd:!:19640::::::
app:$y$j9T$UM/Y02bHn60KKV0X1V1dE1$svy3u9sTpcRfPLeG5VZDbGXjPHUjAHQAsLUQGQrEmL1:19644:0:99999:7:::


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回