ssh without no password

If you want to login remote host B from local host A in background without password:

use

1) ssh-keygen -t rsa in local host A

2) cat $HOME/.ssh/id_rsa.pub | ssh username@B  'cat >> .ssh/authorized_keys && echo "Key uploaded successfully."'


if you have issue like below by:  ssh -vvv B

...

debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
usename@B's password: 

...

The solution to this issue:

I have found a solution. There was an issue in permissions.

/home/usernameon remote machine was granted all permissions, but for key based auth it can be set to 755

or at least you can't give write privileges to any other user except username itself.


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值