Skip to content

Instantly share code, notes, and snippets.

@pniaps
Created March 12, 2018 02:34
Show Gist options
  • Save pniaps/57f7bfe1ba1de6e74e845e78d45a35cd to your computer and use it in GitHub Desktop.
Save pniaps/57f7bfe1ba1de6e74e845e78d45a35cd to your computer and use it in GitHub Desktop.
Install GIT Centos 7
#install git with user
yum install git
adduser git
passwd git
su git
cd
#add public keys to folder and generate autorized keys
mkdir /home/git/.ssh
chmod 700 /home/git/.ssh
touch /home/git/.ssh/authorized_keys
chmod 600 /home/git/.ssh/authorized_keys
mkdir /home/git/keys
cat /home/git/keys/* > /home/git/.ssh/authorized_keys
#create repository
mkdir test-repo.git
cd test-repo.git
git --bare init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment