zoukankan      html  css  js  c++  java
  • CentOS8配置

    启动sshd服务。

    service sshd start
    

    检查sshd服务是否已经启动

    ps -e | grep sshd 
    
    systemctl enable sshd.service
    systemctl list-unit-files | grep sshd
    
    sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' 
             -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.tuna.tsinghua.edu.cn|g' 
             -i.bak 
             /etc/yum.repos.d/CentOS-*.repo
    
    sudo yum makecache         
    
    sudo yum remove docker 
                      docker-client 
                      docker-client-latest 
                      docker-common 
                      docker-latest 
                      docker-latest-logrotate 
                      docker-logrotate 
                      docker-engine
    yum remove podman buildah                  
    
    sudo yum install -y yum-utils
    sudo yum-config-manager 
        --add-repo 
        https://download.docker.com/linux/centos/docker-ce.repo                  
    
    sudo yum install docker-ce docker-ce-cli containerd.io    
    
    sudo systemctl start docker
    
    # Check what interface docker is using, e.g. 'docker0'
    ip link show
    
    # Check available firewalld zones, e.g. 'public'
    sudo firewall-cmd --get-active-zones
    
    # Check what zone the docker interface it bound to, most likely 'no zone' yet
    sudo firewall-cmd --get-zone-of-interface=docker0
    
    # So add the 'docker0' interface to the 'public' zone. Changes will be visible only after firewalld reload
    sudo nmcli connection modify docker0 connection.zone public
    
    # Masquerading allows for docker ingress and egress (this is the juicy bit)
    sudo firewall-cmd --zone=public --add-masquerade --permanent
    # Optional open required incomming ports (wasn't required in my tests)
    # sudo firewall-cmd --zone=public --add-port=443/tcp
    # Reload firewalld
    sudo firewall-cmd --reload
    # Reload dockerd
    sudo systemctl restart docker
    
    # Test ping and DNS works:
    docker run busybox ping -c 1 172.16.0.1
    docker run busybox cat /etc/resolv.conf
    docker run busybox ping -c 1 yourhost.local
    
  • 相关阅读:
    CSS实例:图片导航块
    导航,头部,CSS基础
    web基础,用html元素制作web页面
    web基础
    timestamp与timedelta,管理信息系统概念与基础
    datetime处理日期和时间
    中文词频统计
    文件方式实现完整的英文词频统计实例
    当你发现任务管理器打不开
    恶搞关机
  • 原文地址:https://www.cnblogs.com/chasingdreams2017/p/14255926.html
Copyright © 2011-2022 走看看