Bug 797174

Summary: sftp command does not have '-i' option
Product: Red Hat Enterprise Linux 6 Reporter: Cong Wang <amwang>
Component: opensshAssignee: Petr Lautrbach <plautrba>
Status: CLOSED WORKSFORME QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2CC: miguel, rkhan
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-28 05:56:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 795804, 807884, 815596    

Description Cong Wang 2012-02-24 13:00:20 UTC
Description of problem:
The 'sftp' on RHEL6 doesn't have "[-i identity_file]"
option:

[root@sgi-xe250-02 ~]# sftp
usage: sftp [-1Cv] [-B buffer_size] [-b batchfile] [-F ssh_config]
            [-o ssh_option] [-P sftp_server_path] [-R num_requests]
            [-S program] [-s subsystem | sftp_server] host
       sftp [user@]host[:file ...]
       sftp [user@]host[:dir[/]]
       sftp -b batchfile [user@]host


Version-Release number of selected component (if applicable):

[root@sgi-xe250-02 ~]# rpm -q --whatprovides /usr/bin/sftp
openssh-clients-5.3p1-70.el6_2.2.x86_64


How reproducible:
Always

Additional info:
[-i identity_file] is needed by kdump to provide password-less access via sftp.

Comment 2 Petr Lautrbach 2012-02-27 21:33:59 UTC
Either ssh-agent or 'ssh -o' can be used:

$ ssh-copy-id -i .ssh/account_rsa localhost
account@localhost's password: 
Now try logging into the machine, with "ssh 'localhost'", and check in:

  ~/.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

$ ssh-add ~/.ssh/account_rsa
Enter passphrase for /home/account/.ssh/account_rsa: 
Identity added: /home/account/.ssh/account_rsa (/home/account/.ssh/account_rsa)

$ sftp localhost
Connected to localhost.
sftp> 

$ ssh-add -D
All identities removed.

-----------------

$ sftp -o 'IdentityFile ~/.ssh/account_rsa' localhost
Enter passphrase for key '/home/account/.ssh/account_rsa': 
Connected to localhost.
sftp>

Comment 3 Cong Wang 2012-02-28 05:56:01 UTC
Hi, Petr,

-o 'IdentityFile ~/.ssh/account_rsa' works fine for me, thanks for your help!

I am closing this bug as WORKSFORME.