Bug 797174 - sftp command does not have '-i' option
Summary: sftp command does not have '-i' option
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openssh
Version: 6.2
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Petr Lautrbach
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 795804 807884 815596
TreeView+ depends on / blocked
 
Reported: 2012-02-24 13:00 UTC by Cong Wang
Modified: 2013-09-30 02:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-28 05:56:01 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.