当前位置:   article > 正文

almaLinux上使用podman容器安装centos_almlinux potman

almlinux potman

1.almaLinux系统安装

见:https://blog.csdn.net/qq_50875067/article/details/127384086

2.almaLinux使用podman容器安装centos7.9

2.1下载镜像,启动容器,登入容器

  1. [root@192 ~]# podman pull centos:centos7.9.2009
  2. Resolved "centos" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
  3. Trying to pull quay.io/centos/centos:centos7.9.2009...
  4. Getting image source signatures
  5. Copying blob 2d473b07cdd5 done
  6. Copying config 8652b9f0cb done
  7. Writing manifest to image destination
  8. Storing signatures
  9. 8652b9f0cb4c0599575e5a003f5906876e10c1ceb2ab9fe1786712dac14a50cf
  10. [root@192 ~]# podman images
  11. REPOSITORY TAG IMAGE ID CREATED SIZE
  12. quay.io/centos/centos centos7.9.2009 8652b9f0cb4c 23 months ago 212 MB
  13. [root@192 ~]# podman run -itd 8652b9f0cb4c /bin/bash
  14. 791b073795ba3dc4a74872774354f06947e53ad21da5ea6e3a65f8df597a3946
  15. [root@192 ~]# podman ps
  16. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  17. 791b073795ba quay.io/centos/centos:centos7.9.2009 /bin/bash 17 seconds ago Up 11 seconds ago nostalgic_stonebraker
  18. [root@192 ~]# podman exec -it 791b073795ba /bin/bash
  19. [root@791b073795ba /]# ls
  20. anaconda-post.log bin dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
  21. [root@791b073795ba /]#

2.3设置端口映射,设置密码,建立Xshell远程

  1. [root@791b073795ba /]# exit
  2. exit
  3. [root@192 ~]# podman rm -f 791b073795ba
  4. WARN[0010] StopSignal SIGTERM failed to stop container nostalgic_stonebraker in 10 seconds, resorting to SIGKILL
  5. 791b073795ba3dc4a74872774354f06947e53ad21da5ea6e3a65f8df597a3946
  6. [root@192 ~]# podman ps
  7. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  8. [root@192 ~]# podman run -itd --name=centos -p 5000:22 8652b9f0cb4c /bin/bash
  9. 5402cc8caced8598a39121db98673d70b5ce947bd085feb212695d1c49048723
  10. [root@192 ~]# podman ps
  11. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  12. 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
  13. [root@192 ~]# podman exec -it centos /bin/bash
  14. [root@5402cc8caced /]# yum install -y openssh*
  15. [root@5402cc8caced /]# rpm -qa |grep -E "openssh"
  16. openssh-askpass-7.4p1-22.el7_9.x86_64
  17. openssh-server-sysvinit-7.4p1-22.el7_9.x86_64
  18. openssh-ldap-7.4p1-22.el7_9.x86_64
  19. openssh-7.4p1-22.el7_9.x86_64
  20. openssh-cavs-7.4p1-22.el7_9.x86_64
  21. openssh-clients-7.4p1-22.el7_9.x86_64
  22. openssh-keycat-7.4p1-22.el7_9.x86_64
  23. openssh-server-7.4p1-22.el7_9.x86_64
  24. [root@5402cc8caced /]# whoami
  25. root
  26. [root@5402cc8caced /]# echo 12345678|passwd --stdin root
  27. Changing password for user root.
  28. passwd: all authentication tokens updated successfully.
  29. [root@5402cc8caced /]#

启动sshd, 失败

systemctl start sshd

安装 initscripts

yum install initscripts

重启sshd服务

  1. service sshd restart
  2. #systemctl start sshd

Xshell连接

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/159055?site
推荐阅读
相关标签
  

闽ICP备14008679号