zoukankan      html  css  js  c++  java
  • ue4 shooterGame 第一步 搭建git linux服务器

    1、分别在linux(服务器)上安装git、和openssh服务,

      在windows(客户机)上安装cygwin,模拟linux环境以及安装windows git客户端。

    2、windows的cygwin环境安装SSH服务:

      运行 C:cygwin64Cygwin.bat或终端

      在窗口中输入  

      ssh-host-config
      *** Query: Should privilege separation be used? <yes/no>: yes
      *** Query: New local account 'sshd'? <yes/no>: yes
      *** Query: Do you want to install sshd as a service?
      *** Query: <Say "no" if it is already installed as a service> <yes/no>: yes
      *** Query: Enter the value of CYGWIN for the deamon: [] binmode ntsec
      *** Query: Do you want to use a different name? (yes/no) yes/no
    

      如果用相同的名字 cyg_server, 输入no. 

      *** Query: Create new privileged user account 'cyg_server'? (yes/no) yes
      *** Query: Please enter the password:
      *** Query: Renter:
    

      如果选择不同的名字, 输入 yes. 

      *** Query: Enter the new user name: cyg_server1
      *** Query: Reenter: cyg_server1
      *** Query: Create new privileged user account 'cyg_server1'? (yes/no) yes
      *** Query: Please enter the password:
      *** Query: Reenter:
      配置相应的密码,输入yes

      配置成功,你会看到下面消息:

      Host configuration finished. Have fun!
      启动SSH服务
        在Cygwin 终端    输入bash    再输入 net start sshd
      创建一个ssh key在window客户机上
        我们使用命令:ssh-keygen –t rsa 生成密钥(在cgywin的根目录的.ssh文件下保存id_rsa和id_rsa.pub文件)
    3、在linux服务器上新建一个git用户。并禁止ssh通过此用户登陆liunx服务器
      ***服务器端设置git用户
        useradd git
        passwd git
      ***禁用shell登录:
        vi /etc/passwd:
        将
        git:x:1001:1001:,,,:/home/git:/bin/bash 改成
        git:x:1001:1001:,,,:/home/git:/usr/bin/git-shell
    4、创建git仓库
      mkdir -p /home/git/swportal.git
      git init --bare /home/git/swportal.git
      cd /home/git
      chown -R git:git swportal.git/
    5、无密码上传,下载文件

      我们 通过命令scp /home/git/.ssh/id_rsa.pub gitServer:/home/git将gitClient_01上生成的公钥拷贝到gitServer上。

      在gitServer上我们首先查看/home/git/.ssh目录下是否存在authorized_kesys文件,

      如果没有,可以通过touch authorized_keys创建此文件。

      Authorized_keys创建完成后,将gitClient_01上拷贝过来的公钥id_rsa.pub的内容追 加到authroized_keys中,注意是追加到此文件中,可以使用命令cat   /home/git/id_rsa.pub>>/home/git/.ssh/authorized_keys.

    6、***添加远程git仓库链接并push本地库内容给远程库
      git remote add origin2 root@109.110.100.56:/usr/src/git-2.1.2/data/git/swportal.git
      git push -u origin master

    7、***git远程命令(记得把git push文件所在的文件夹的权限给成全部控制)
       git remote
       git clone
       git fetch
       git pull
       git push

     

     
     
    欢迎大家来我的新家看一看 3wwang个人博客-记录走过的技术之路
  • 相关阅读:
    c#两级菜单menu的动态实现
    单引号写入数据库,并结合写成函数和动静态类中方法对比小结
    google地图路径查询
    c# 图像旋转
    google地图简单
    asp.net gridview 添加属性
    linq to entity Oracle 执行存储过程或函数
    c# 判断非法字符
    c# 写入文件
    google map Inspecting DirectionsResults
  • 原文地址:https://www.cnblogs.com/wang985850293/p/6235813.html
Copyright © 2011-2022 走看看