hj_服务器操作记录
~~~阿里云云服务器(1核2G1M带宽40G云盘.centos8.3 64位 华南1区 2022-12-19到期)
服务器暴露端口设置(3301-3309, 6001-6999, 8001-8999, 9001-9999 10240-10245全部暴露 )
1 创建用户组.添加用户并给管理员权限:
创建组: groupadd hj_manager_group 查看组: cat /etc/group
添加用户: useradd -g hj_manager_group -m hj 查看单用户: id hj 查看所有用户: cat /etc/passwd | grep hj
创建密码: passwd hj 设置root权限: sudo vim /etc/sudoers root ALL=(ALL) ALL <--> hj ALL=(ALL) ALL
事实证明.这个没啥用,还是没有权限~~~还是root用户才好玩.
2 安装docker/podman
查看是否安装过: yum list installed |grep docker
安装: yum -install docker -y ps: 需要root权限,可加sudo~ -y表示不询问安装,直到安装成功,安装完后再次查看安装列表
docker --version Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet ms这是因为与podman冲突.
podman是一个跟docker差不多的容器,语句也基本想通,可以理解为docker升级版,是centos8自带的不需要下载,如果再去下载docker会被放在podman下
所以移除docker安装~ sudo:yum remove docker
安装 podman , yum list installed | grep podman , sudo yum install podman -y , podman --version 显示: podman version 3.3.1
设置别名: alias docker=podman docker images podman images 一样的效果. ps:非一次设置一直有效..
常用命令~~~
Commands Podman (Pod Manager) Global Options, Environment Variables, Exit Codes, Configuration Files, and more attach Attach to a running container auto-update Auto update containers according to their auto-update policy build Build an image using instructions from Containerfiles commit Create new image based on the changed container container Manage Containers cp Copy files/folders between a container and the local filesystem create Create but do not start a container diff Inspect changes on container’s file systems events Show podman events exec Run a process in a running container export Export container’s filesystem contents as a tar archive generate Generated structured data healthcheck Manage Healthcheck history Show history of a specified image image Manage images images List images in local storage import Import a tarball to create a filesystem image info Display podman system information init Initialize one or more containers inspect Display the configuration of a container or image kill Kill one or more running containers with a specific signal load Load an image from container archive login Login to a container registry logout Logout of a container registry logs Fetch the logs of a container machine Manage podman’s virtual machine manifest Create and manipulate manifest lists and image indexes mount Mount a working container’s root filesystem network Manage Networks pause Pause all the processes in one or more containers play Play a pod pod Manage pods port List port mappings or a specific mapping for the container ps List containers pull Pull an image from a registry push Push an image to a specified destination rename Rename an existing container restart Restart one or more containers rm Remove one or more containers rmi Removes one or more images from local storage run Run a command in a new container save Save image to an archive search Search registry for image secret Manage podman secrets start Start one or more containers stats Display a live stream of container resource usage statistics stop Stop one or more containers system Manage podman tag Add an additional name to a local image top Display the running processes of a container unmount Unmounts working container’s root filesystem unpause Unpause the processes in one or more containers unshare Run a command in a modified user namespace untag Removes one or more names from a locally-stored image version Display the Podman Version Information volume Manage volumes wait Block on one or more containers 来自官网: https://docs.podman.io/en/latest/Commands.html