大网数据广告活动
服务器运维问答

Why am I still prompted for a password using sftp?

· 52CE 我爱测

The remote system has the public key. My .ssh/config file reads as follows: Host fubar Hostname fubar.ip.address.here User fubar_userid Port 22 known_hosts entry: (same ip address as used #2) fubar.ip.address.here ssh-rsa BLAH_BL…

问题原文

原帖链接 · zundarz · CC BY-SA 3.0

  1. The remote system has the public key.

  2. My .ssh/config file reads as follows:

 Host     fubar
 Hostname fubar.ip.address.here
 User     fubar_userid   
 Port     22
  1. known_hosts entry: (same ip address as used #2)

    fubar.ip.address.here ssh-rsa BLAH_BLAH_key.....

Results of command:

$>sftp fubar
Connecting to fubar ....
[email omitted]'s password:

Questions:
Why am I stil prompted for a password? What do I need to change to connect using keys and not get propmted for a password?

已采纳解答

原帖链接 · Charles Burge · CC BY-SA 3.0

It's not clear to me if you're trying to set up SSH keys. Have a look here for directions on how to do that.

Pay special attention to the part where you enter a passphrase. If you do not leave it empty, then you will still need to enter that passphrase when you want to connect. You might be asking yourself "OK, why go to all that trouble if I still need to enter a passphrase?" The answer is that this particular passphrase is to decrypt your local key when you want to use it. The passphrase never traverses the wire to the server, even in hashed form. You would want to use a passphrase if this is on a machine where someone else has root access (such as a hosted server), because if someone else gets your key, they would not be able to use it without decrypting it. However, if this is on your own local machine where only you have access, then you can consider it safe to leave the passphrase blank. That way, you can SSH or SFTP without ever being prompted.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-09-26)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。