LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-26-2011, 02:54 PM   #1
chicagovol
LQ Newbie
 
Registered: May 2011
Location: Chicago
Distribution: CentOS5.4/RHEL5.3
Posts: 2

Rep: Reputation: 10
SFTP fails public key authentication in batch mode


I am attempting to set up an automatic transfer via sftp using public key authentication. I have created a public/private key pair to connect to the remote server without using a password. I have also been able to use this key pair to login from the command line: sftp -vvv -oPort=<server-side port> user@server.

Debug info from interactive command:
Code:
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/cdurbin/.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 1d:77:ac:ab:54:aa:c9:6a:cd:64:44:12:ad:fc:b6:36:50:ce:18:c1
debug3: sign_and_send_pubkey
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
However, when I attempt to use sftp in batch mode, the authentication fails: sftp -vvv -b<batchfile> -oPort=<server-side port> user@server

Debug from failed authentication:
Code:
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/cdurbin/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey,password,keyboard-interactive).
Couldn't read packet: Connection reset by peer
Does anyone have any idea why it would work for one method but not the other?
 
Old 05-26-2011, 03:52 PM   #2
chicagovol
LQ Newbie
 
Registered: May 2011
Location: Chicago
Distribution: CentOS5.4/RHEL5.3
Posts: 2

Original Poster
Rep: Reputation: 10
Lightbulb So simple it's stupid

I had mistyped the username in the batch mode script.

You lose your focus for just a minute...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help with public key authentication rookie7799 Linux - Security 8 05-26-2012 12:41 AM
SFTP/SCP with Key Authentication problem on Android Trijicon Linux - Mobile 1 06-27-2010 03:15 PM
SFTP without password and without public/ private key iamakshay Programming 2 10-19-2009 04:35 PM
SSH public key authentication Jeroen1000 Linux - Security 12 09-07-2009 04:14 AM
Public key authentication problem Gameon Linux - Security 7 01-02-2004 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration