赞
踩
见:https://blog.csdn.net/qq_50875067/article/details/127384086
- [root@192 ~]# podman pull centos:centos7.9.2009
- Resolved "centos" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
- Trying to pull quay.io/centos/centos:centos7.9.2009...
- Getting image source signatures
- Copying blob 2d473b07cdd5 done
- Copying config 8652b9f0cb done
- Writing manifest to image destination
- Storing signatures
- 8652b9f0cb4c0599575e5a003f5906876e10c1ceb2ab9fe1786712dac14a50cf
- [root@192 ~]# podman images
- REPOSITORY TAG IMAGE ID CREATED SIZE
- quay.io/centos/centos centos7.9.2009 8652b9f0cb4c 23 months ago 212 MB
- [root@192 ~]# podman run -itd 8652b9f0cb4c /bin/bash
- 791b073795ba3dc4a74872774354f06947e53ad21da5ea6e3a65f8df597a3946
- [root@192 ~]# podman ps
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- 791b073795ba quay.io/centos/centos:centos7.9.2009 /bin/bash 17 seconds ago Up 11 seconds ago nostalgic_stonebraker
- [root@192 ~]# podman exec -it 791b073795ba /bin/bash
- [root@791b073795ba /]# ls
- anaconda-post.log bin dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
- [root@791b073795ba /]#
- [root@791b073795ba /]# exit
- exit
- [root@192 ~]# podman rm -f 791b073795ba
- WARN[0010] StopSignal SIGTERM failed to stop container nostalgic_stonebraker in 10 seconds, resorting to SIGKILL
- 791b073795ba3dc4a74872774354f06947e53ad21da5ea6e3a65f8df597a3946
- [root@192 ~]# podman ps
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- [root@192 ~]# podman run -itd --name=centos -p 5000:22 8652b9f0cb4c /bin/bash
- 5402cc8caced8598a39121db98673d70b5ce947bd085feb212695d1c49048723
- [root@192 ~]# podman ps
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- 5402cc8caced quay.io/centos/centos:centos7.9.2009 /bin/bash 55 seconds ago Up 54 seconds ago 0.0.0.0:5000->22/tcp centos
- [root@192 ~]# podman exec -it centos /bin/bash
- [root@5402cc8caced /]# yum install -y openssh*
- [root@5402cc8caced /]# rpm -qa |grep -E "openssh"
- openssh-askpass-7.4p1-22.el7_9.x86_64
- openssh-server-sysvinit-7.4p1-22.el7_9.x86_64
- openssh-ldap-7.4p1-22.el7_9.x86_64
- openssh-7.4p1-22.el7_9.x86_64
- openssh-cavs-7.4p1-22.el7_9.x86_64
- openssh-clients-7.4p1-22.el7_9.x86_64
- openssh-keycat-7.4p1-22.el7_9.x86_64
- openssh-server-7.4p1-22.el7_9.x86_64
-
- [root@5402cc8caced /]# whoami
- root
- [root@5402cc8caced /]# echo 12345678|passwd --stdin root
- Changing password for user root.
- passwd: all authentication tokens updated successfully.
- [root@5402cc8caced /]#
启动sshd, 失败
systemctl start sshd
安装 initscripts
yum install initscripts
重启sshd服务
- service sshd restart
- #systemctl start sshd
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。