文章标签 ‘SSH’
1) 在本地机器中的~/.ssh/目录下执行下命令, (linux本身自带了,windows下可以使用Cygwin或者使用http://code.google.com/p/msysgit都行,你还可以在linux下生成好了再下载到本机用户目录下.ssh) ssh-keygen -t dsa 将生成两个文件,id_dsa和id_dsa.pub. 2) 将id_dsa.pub拷贝到远程机器,并且将id_dsa.pub的内容添加到~/.ssh/authorized_keys中. cat id_dsa.pub >> ~/.ssh/authorized_keys 注意:目录.ssh的权限必须是700;文件authorized_keys的权限必须是600. su – chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys 调试 ssh -vvv git@192.168.0.62 如果出现错误信息基本上都是文件权限的设定有问题。 常见的错误信息有 Permission denied (publickey,gssapi-with-mic) fatal: The remote end hung up unexpectedly 要求输入密码 Password: [via]
分类: IT技术
标签: SSH
