dnf install git -y
id it
useradd git
su git
cd
mkdir .ssh && chmod 700 .ssh
touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
cat /tmp/id_rsa.john.pub >> ~/.ssh/authorized_keys
mkdir -p /opt/git/repo.git
git init --bare /opt/git/repo.git
chown -R git:git /opt/git
cat /etc/shells # see if `git-shell` is already in there. If not...
which git-shell # make sure git-shell is installed on your system.
vim /etc/shells # and add the path to git-shell from last command
chsh git # and enter the path to git-shell, usually: /usr/bin/gitshell
git clone git@ip:/opt/git/repo.git
https://www.cnblogs.com/dee0912/p/5815267.html
https://git-scm.com/book/zh/v2 - 服务器上的git
原文地址:https://www.cnblogs.com/wswind/p/10373881.html
时间: 2024-10-31 08:50:17