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项目目录

OpenWrt Aria2开启SSL

在Aria2设置中将 配置文件目录改为 :/opt/aria2

上传证书文件至/opt/aria2

编辑/etc/init.d/aria2 查找append_setting “xxxxxxxxxxxxxxxxx” 在后面一行添加

append_setting "rpc-secure=true"
append_setting "rpc-certificate=$config_dir/uhttpd.crt"
append_setting "rpc-private-key=$config_dir/uhttpd.key"

重启Aria2即可