Dict.CN 在线词典, 英语学习, 在线翻译 ------------- MyGitee 朱秋贵内科诊所 My腾云code

docker-git server

*************************************
*************************************
***********git *****************
*****172.17.0.2:22*****************
****宿机192.168.157.128**************
******************************************************
****https://www.cnblogs.com/liter7/p/6581344.html
******************************************************
  12-1、docker run -it --privileged --name git   -p 30022:22  docker.io/centos:latest
            ##docker exec -it git  /bin/bash

  12-2、安装git
     yum -y install git    

  12-2、建裸仓库(以.git结尾)
    ####lestgit   
    cd /usr/local
    mkdir git
    cd git

    git init --bare testgit.git


  12-3、创git用户
      useradd git
      passwd git

  12-4、git用户权限
    chown -R git:git testgit.git


  12-5、禁git用户shell登录(*)
       vi /etc/passwd
     将git用户 如下(最后一行)
          git:x:1000:1000::/home/git:/usr/bin/git-shell


  12-6、 ###22端口###############     
        netstat -antp | grep sshd
        ssh localhost

  12-7、/usr/local/git

  12-8、宿机/客机

        ###宿机:   ssh  -p 22 root@172.17.0.2  
        ###客机:   telnet 192.168.157.128  30022

  12-9、####git#######
        默认端口22
        #############
          ##宿机git####
          #####git clone git@172.17.0.2:/usr/local/git/testgit.git    
        

                 ##客机git####非22端口
                      #####git clone ssh://git@192.168.157.128:30022/usr/local/git/testgit.git

 

 

 

 

 

 

 

 

 

 

 

 

 

 

###############################
service: command not found
#####service可用################
1)、yum list | grep initscripts
 
   ##initscripts.x86_64

2)、yum install initscripts -y






###############################
##############ssh###############
1)、rpm -qa|grep -E "openssh"
2)、yum install openssh*
3)、service sshd start
netstat -antp | grep sshd
https://www.cnblogs.com/SciProgrammer/p/7818770.html

 

posted @ 2020-06-27 13:53  cn2023  阅读(353)  评论(0编辑  收藏  举报