java sftp 公钥_ssh – sftp和公钥

我正试图进入由其他人托管的服务器.

为了确保这个工作,我做了标准的sftp user@sftp.xxxxxx.com我得到了密码,并且工作正常.

我正在设置一个cron脚本来每周发送一次文件,所以给了他们我们公开的密钥,他们声称这些密钥已经添加到他们的authorized_keys文件中.

我现在再次尝试sftp user@sftp.xxxxxx.com,但仍然提示输入密码,但现在密码不起作用…

Connecting to user@sftp.xxxxxx.com...

user@sftp.xxxxxx.com's password:

Permission denied, please try again.

user@sftp.xxxxxx.com's password:

Permission denied, please try again.

user@sftp.xxxxxx.com's password:

Permission denied (publickey,password).

Couldn't read packet: Connection reset by peer

我确实注意到,如果我只是按下输入(没有密码),它记录我很好…

所以这是我的问题:

>有没有办法检查什么私钥/ pulbickey配对我的sftp

连接正在使用?

>是否可以指定要使用的密钥对?

>如果所有设置都正确(使用正确的密钥对并添加到授权文件),为什么要求我输入空白密码?

感谢您的帮助!

UPDATE

我刚刚运行了sftp -vvv user@sftp.xxxxxx.com

....

debug1: Authentications that can continue: publickey,password

debug3: start over, passed a different list publickey,password

debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password

debug3: authmethod_lookup publickey

debug3: remaining preferred: keyboard-interactive,password

debug3: authmethod_is_enabled publickey

debug1: Next authentication method: publickey

debug1: Offering public key: /root/.ssh/id_rsa

debug3: send_pubkey_test

debug2: we sent a publickey packet, wait for reply

debug1: Server accepts key: pkalg ssh-rsa blen 277

debug2: input_userauth_pk_ok: SHA1 fp 45:1b:e7:b6:33:41:1c:bb:0f:e3:c1:0f:1b:b0:d5:e4:28:a3:3f:0e

debug3: sign_and_send_pubkey

debug1: read PEM private key done: type RSA

debug1: Authentications that can continue: publickey,password

debug1: Trying private key: /root/.ssh/id_dsa

debug3: no such identity: /root/.ssh/id_dsa

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

它似乎暗示它试图使用公钥…我错过了什么?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值