OpenWRT git服务器

安装服务:

#opkg install git

#opkg install shadow-useradd shadow-su

执行命令:

#useradd git && passwd git

#vi /etc/passwd

git:x:32769:32769::/opt/git:/usr/bin/git-shell

#vi /etc/shells

/bin/ash
/usr/bin/git-shell

新建/opt/git rwxr—–权限

新建/opt/git/.ssh rwxr—–权限

#su git

#dropbearkey -t rsa -s 1024 -f ~/.ssh/dropbear_rsa_host_key
#dropbearkey -y -f ~/.ssh/dropbear_rsa_host_key >> ~/.ssh/authorized_keys

authorized_keys rw-r–r–权限

将其他机器公钥放到要免密登录的机器~/.ssh/authorized_keys下

git init –bare xxx项目目录