docker 容器开启ssh及查看容器占用磁盘大小

韵味老鸟2024-05-19 20:53:00  125

一:docker 查看容器占用磁盘大小

docker 查看容器占用磁盘大小

root@pack:/data# docker system df

TYPE TOTAL ACTIVE SIZE RECLAIMABLE

Images 162 43 1.035TB 1.013TB (97%)

Containers 87 39 237.8GB 119.1GB (50%)

Local Volumes 1 1 17.08kB 0B (0%)

Build Cache 0 0 0B 0B

root@pack:/data#

查看 每个 image、container 详细大小:docker system df -v

二:docker 容器开启ssh

docker 容器开启ssh

启动sshd:

# /usr/sbin/sshd -D &

正常启动需要pid文件存在,可以创建/var/run/sshd

这时报以下错误:

[root@ b5926410fe60 /]# /usr/sbin/sshd

在密码正确的时候,SSH登录提示报错

Permission denied, please try again.

进入登录调试模式

debug1: Next authentication method: password

debug1: Authentications that can continue: publickey,password

Permission denied, please try again.

原因:ubuntu配置SSDH的问题

解决,修改配置,允许root登录,重启SSH

root@d4f098015c48:~# grep Root /etc/ssh/sshd_config

PermitRootLogin prohibit-password # prohibit-password 修改为:Yes

the setting of "PermitRootLogin without-password".

root@d4f098015c48:~# cat /etc/issue

Ubuntu 16.04.6 LTS l

root@d4f098015c48:~# vi /etc/ssh/sshd_config

root@d4f098015c48:~# which sshd

/usr/sbin/sshd

root@d4f098015c48:~# ps -ef|grep sshd

root 39 0 0 10:36 ? 00:00:00 /usr/sbin/sshd

root 105 52 0 13:05 pts/1 00:00:00 grep --color=auto sshd

root@d4f098015c48:~# kill -9 39

root@d4f098015c48:~# ps -ef|grep sshd

root@d4f098015c48:~# /usr/sbin/sshd

root@d4f098015c48:~# ps -ef|grep sshd

root 109 0 0 13:05 ? 00:00:00 /usr/sbin/sshd

root 111 52 0 13:05 pts/1 00:00:00 grep --color=auto ssh

转载此文是出于传递更多信息目的。若来源标注错误或侵犯了您的合法权益,请与本站联系,我们将及时更正、删除、谢谢。
https://www.414w.com/read/557217.html
0
最新回复(0)