免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: jiwang1980
打印 上一主题 下一主题

大神们,ssh登录问题求解啊~ [复制链接]

论坛徽章:
0
11 [报告]
发表于 2011-12-24 09:04 |只看该作者
不是权限问题,权限问题应该在/var/log/secure里面有记录吧

我尝试修改权限,仍需密码

论坛徽章:
0
12 [报告]
发表于 2011-12-24 11:25 |只看该作者
换了台虚拟机,没有问题。
人品问题,也不想深究了,谢谢各位回复

论坛徽章:
0
13 [报告]
发表于 2011-12-26 17:21 |只看该作者
试试这个方法,我之前遇到过类似问题,应该还是目录和文件的权限问题:

1. Create a public ssh key, if you haven’t one already.

Look at ~/.ssh. If you see a file named id_dsa.pub then you obviously already have a public key. If not, simply create one. ssh-keygen -t dsa should do the trick.

Please note that there are other types of keys, e.g. RSA instead of DSA. I simply recomend DSA, but keep that in mind if you run into errors.

2. Make sure your .ssh dir is 700:
chmod 700 ~/.ssh


3. Get your public ssh key on the server you want to login automatically.
A simple scp ~/.ssh/id_dsa.pub remoteuser@remoteserver.com: is ok.


4. Append the contents of your public key to the ~/.ssh/authorized_keys and remove it.

Important: This must be done on the server you just copied your public key to. Otherwise you wouldn’t have had to copy it on your server.

Simply issue something like ---
cat id_dsa.pub >> .ssh/authorized_keys while at your home directory.


5. Instead of steps 3 and 4, you can issue something like this:

cat ~/.ssh/id_dsa.pub | ssh -l remoteuser remoteserver.com 'cat >> ~/.ssh/authorized_keys'


6. Remove your public key from the home directory on the server.


7. Done!
You can now login:

ssh -l remoteuser remoteserver.com or ssh remoteuser@remoteserver.com

without getting asked for a password.

论坛徽章:
0
14 [报告]
发表于 2011-12-26 17:22 |只看该作者
补充一点:被远程登录的主机上用户的主目录的权限必须为755
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP