linerboss.blogg.se

Git add remote repository ssh
Git add remote repository ssh









# cat /dev/shm/id_rsa.pub > authorized_keys Operate in git’s home as root # cd /home/git/.sshīackup before changing is a good habit # cp authorized_keys authorized_keys.bakĪppend pub key to git’s autorized keys list Log on to git server, using the account that have root or sudo privilege ssh pub key to a temp directory Hence, we should create the COMMAND_DIR in git’s home and give read and execute permission to git:Īdd id_rsa.pub to git’s.

git add remote repository ssh

The user must have read and execute permissions to the directory in order to execute the programs in it. In addition, COMMAND_DIR (the path “$HOME/git-shell-commands”) must exist and any of the executables in it can be invoked. To make this work, the /usr/bin/git-shell should be put into /etc/shells to avoid “user ‘git’ has invalid shell, rejected” error. One good method (thanks to victor) is to use the usermod command: # usermod -s /usr/bin/git-shell git It can be made by editing /etc/passwd, but this is not suggested. Then we can change git’s shell from /bin/bash to /usr/bin/git-shell to forbid logging in for a shell for the git account. Here we assume git’s home directory is /home/git.

git add remote repository ssh

Logon to the git server by ssh username is the account name that have administrator privilege (or can sudo) on the git server.Īdd the user for git # useradd -m -d /home/git -u 1005 gitĬonfigure the git user’s shell # vim /etc/passwd Suppose that we set up git server on machines. The git server can be directly connected. We use ssh to pull or push data from or to git server. In this part we will build up a git server through ssh connection.

#Git add remote repository ssh how to

In this post how to set up a basic git server and a more complex one (the git server is a server inside of a local area network) will be introduced. The gitosis proves quit stable from my experience, although it does not have as many features as gitolite. If you prefer gitosis, please refer to: ] and ]. You may check out ] for how to set up a git server using gitolite.

git add remote repository ssh

If you need to set up a git server for multiple users which may contain contributors and administrator, you may try ] as recommended by ].









Git add remote repository ssh