http://blog.csdn.net/wave_1102/article/details/47779401 这个有一步省略了我来补充
这个要看好自己的git装在那个位置上 不一定为/data/git
我的为root/
1、把本地的ssh公钥文件安装到远程主机对应的账户下:
ssh-copy-id user@server
ssh-copy-id -i ~/.ssh/id_rsa.pub user@server
(user为root最好 不然不够权限)
(sever为公网ip)