LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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-09-2011, 08:43 PM   #1
mrees
LQ Newbie
 
Registered: May 2011
Posts: 3

Rep: Reputation: 0
Question scp failing intermittently


HI,
I have been searching the web but haven’t found any similar instances I can reference for this issue… I have users that are trying to scp files via a script from host A to host B. The script is set to sleep 30 seconds before each file transfer begins. If the user tries to send 6 files, 2-4 of the files will randomly fail the transfer. They are all using the same private and public key sets so I can’t figure out why some copy and others don’t.

Here is a snippet from a successful transfer:
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /export/home/XXXadmin/.ssh/identity
debug1: Offering public key: /export/home/XXXadmin/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: scp -v -t /app/SI_ops/exchange
Sending file modes: C0664 3440 EDNO.EDI209_14.1Tue_Apr_26_06_03_00_2011
Sink: C0664 3440 EDNO.EDI209_14.1Tue_Apr_26_06_03_00_2011
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
debug1: fd 2 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.2 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 0
scpstatus=0
scp status=0

Here is an example of a failed transfer run during the same script:
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /export/home/XAAadmin/.ssh/identity
debug1: Offering public key: /export/home/XAAdmin/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password,keyboard-interactive
debug1: Offering public key: /export/home/XAAadmin/.ssh/id_dsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-with-mic,password,keyboard-interactive
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-with-
mic,password,keyboard-interactive
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
Received disconnect from 10.100.100.100: 2: Too many authentication failures for XAAadmin
lost connection
scpstatus=1
scp status=1 not successful

There is a /dev/tty device on the system
[root ]# ls -al /dev/tty
crw-rw-rw- 1 root tty 5, 0 May 9 17:03 /dev/tty
[root]#

Any ideas why I am getting this intermittent scp failure?
 
Old 05-09-2011, 11:04 PM   #2
plpl303a
Member
 
Registered: May 2011
Posts: 52

Rep: Reputation: 3
Would the home directories on the remote system be automounted or accessed via some sort of mount-on-login operation? If so, that might explain why the system intermittently fails to find the ~/.ssh/authorized_keys file on the remote side: There's a race condition between whether the automounter can finish its work before the ssh server tries to read the authorized_keys file.

I'd surmise that keyboard-interactive authentication fails because you're running from a script and don't have a tty available from the script (since it's non-interactive).
 
Old 05-10-2011, 04:45 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,929

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Welcome to LinuxQuestions.
Since you mention user(s) my first guess is if they are all trying to send files at the same time you could be exceeding either the MaxSessions or MaxStartup values. The default value is 10. If this is the case then you can change the values in /etc/ssh/sshd_config. You can also use wildcards to transfer more then one file at a time.
 
Old 05-10-2011, 01:43 PM   #4
mrees
LQ Newbie
 
Registered: May 2011
Posts: 3

Original Poster
Rep: Reputation: 0
I increased the values for MaxSessions or MaxStartup to 15, but we are still seeing the intermittent copy failure. I got a little more info from the users - In the script they are using, it is scp’ing files to different directories so wild cards won’t work. It sounds like they are kicking off several different scp sessions at one time. I had them enter a 60 second sleep interval between kicking off scp sessions but that didn’t fix it.

The .ssh directory with the authorized keys is on a local mount. I don’t really understand the tty availability – from what I can tell the /dev/tty is there on the system. Is there a way run the script without requiring or specifying the tty?

[root ]# ls -al /dev/tty
crw-rw-rw- 1 root tty 5, 0 May 9 17:03 /dev/tty
[root]#

On the failed copies it’s like they scp session doesn’t read the ssh keys.
 
Old 05-10-2011, 02:16 PM   #5
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
The /dev/tty error is not related to your issue. Once public key authentication fails, it moves down the list of permitted authentications. Once it gets to "password", it fails because you're running from a script, and don't have an interactive shell in which you can enter a password. In other words, if your public key authentication was working properly, you'd never see this.

I see a possible syntax error here:

debug1: Trying private key: /export/home/XAAadmin/.ssh/identity
debug1: Offering public key: /export/home/XAAdmin/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password,keyboard-interactive
debug1: Offering public key: /export/home/XAAadmin/.ssh/id_dsa

Is that accidental?
 
Old 05-10-2011, 02:28 PM   #6
mrees
LQ Newbie
 
Registered: May 2011
Posts: 3

Original Poster
Rep: Reputation: 0
yes, the XAAadmin was me trying to obscure the user directory... probably wasn't very helpful. The part where it doesn't read the public key authentication is the part that has me baffled because it is using the same user/keys for all files being copied in the script. Some scp sessions read the keys OK and others don't?? Am I missing a configuration somewhere?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
scp does not work and gives the following error message: scp: FATAL: Executing ssh1 i akay Linux - Networking 16 09-29-2008 12:41 AM
compiz failing, GLcore.so failing to load Schrambo Linux - Desktop 4 02-23-2008 07:13 PM
eth1 failing on boot, IEEE firewire card driver failing, help jackuss_169 Linux - Laptop and Netbook 5 03-05-2005 08:34 AM
LILO install failing, Boot failing, but Installation fine. sramelyk Slackware 9 08-23-2003 03:37 PM
X failing to load; AddScreen/InitScreen failing for driver 0 weblion Linux - Software 1 08-01-2002 07:14 AM


All times are GMT -5. The time now is 06:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration