LoginSignup
3

More than 5 years have passed since last update.

サーバにgitレポジトリを作成

Posted at

参考URL
https://blog.apar.jp/linux/2300/

# yum install -y git
# useradd -s /usr/bin/git-shell git 
# mkdir /home/git/.ssh 
# touch /home/git/.ssh/authorized_keys
# chown -R git:git /home/git/.ssh 
# chmod 700 /home/git/.ssh 
# chmod 600 /home/git/.ssh/authorized_keys 
# mkdir /opt/git 
# mkdir /opt/git/sample.git
# cd /opt/git/sample.git/ 
# git init --bare
# chown -R git:git /opt/git/sample.git/ 

クライアントPCのSSH公開鍵をクリップボードにコピー

# cat ~/.ssh/id_rsa.pub

サーバにペースト

# vim /home/git/.ssh/authorized_keys
# vi /etc/ssh/sshd_config
...
# LogLevel DEBUG
...
# service sshd restart 
# git clone ssh://git@[domain]/opt/git/sample.git 

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3