LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-06-2009, 12:07 AM   #1
callagga
Member
 
Registered: Jan 2008
Posts: 36

Rep: Reputation: 15
Question get "failed password" when scripts ssh in, but ok when I manually ssh in???


Hi guys,

I'm stuck on this. I can ssh my target prod server (call it server A), and from there ssh into my repo server (say server B) fine. When I run some scripts that are accessing server B from server A via ssh however they get a a "failed password". Any ideas? What is the difference from server B's perspective how the ssh connection is being established? Here's a tail of the secure.log from Server B for both cases.

---------- server B log when "manually ssh'ing in " -------------------
Feb 6 15:23:18 Macintosh-2 com.apple.SecurityServer[21]: checkpw() succeeded, creating credential for user greg
Feb 6 15:23:18 Macintosh-2 com.apple.SecurityServer[21]: checkpw() succeeded, creating shared credential for user greg
Feb 6 15:23:18 Macintosh-2 com.apple.SecurityServer[21]: Succeeded authorizing right system.login.tty by client /usr/sbin/sshd for authorization created by /usr/sbin/sshd.
Feb 6 15:23:18 Macintosh-2 sshd[2372]: Accepted keyboard-interactive/pam for greg from 10.1.1.1 port 49636 ssh2

--------- server B log when scripts are trying to access ------------
Feb 6 15:23:53 Macintosh-2 sshd[2414]: error: PAM: Authentication failure for greg from home.gregsdomainname.org
Feb 6 15:23:53: --- last message repeated 2 times ---
Feb 6 15:23:53 Macintosh-2 sshd[2414]: Failed password for greg from 10.1.1.1 port 50366 ssh2

Not sure if it's significant, however I acutally trigger the scripts running on Server A from Server B itself. Hence end-to-end it is:

Server A (run capistrano init) ==ssh==> Sever B (run scripts) ====ssh===>Server A

Server B ssh config (/etc/ssh_config)
=========================
Macintosh-2:etc greg$ cat /etc/ssh_config
# Host *
# ForwardAgent no
# ForwardX11 no
# RhostsRSAAuthentication no
# RSAAuthentication yes
PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication yes
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange yes
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# Port 22
# Protocol 2,1
# Cipher 3des
# Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no




Thanks
 
Old 02-06-2009, 02:16 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by callagga
When I run some scripts that are accessing server B from server A via ssh however they get a a "failed password".
How are you authenticating to server B from within the script? Normally you'd use Pubkey Authentication (with no passphrase) for this purpose.
 
Old 02-06-2009, 02:36 PM   #3
callagga
Member
 
Registered: Jan 2008
Posts: 36

Original Poster
Rep: Reputation: 15
good question - as I'm using capistrano (www.capify.org) I'm not sure exactly. When I manually ssh across it's just a basic username/password (no keys).

What seems to be happening is (I think), capistrano aids in deploying your application, and effectively you kick it off on your DEV box (call it server DEV). It then uses it own approach to ssh into your PROD server (server A) and run the scripts. In this case it should be running a script on server A that then uses git (git-scm.com) [which itself uses ssh], to ssh to server B (which has the repository) to grab the latest copy of the code.

To complicate things a little:
* My dev box (server DEV) is actually the same box as server B (with repository). Not sure if this is significant.
* I do run two (2) ssh daemons ("sshd" and "sshd_local"). I use "sshd" for external access on a different port and requiring keys, where as "sshd_local" runs on the normal port with basic username/password. I'm not specifying the port for the external "sshd" server so this shouldn't be an issue (I hope).
 
Old 02-06-2009, 02:46 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I don't know what your third-party app is doing, but if it gives you the latitude to configure user authentication, you're going to want to switch to pubkeys. Failing that, double-check the user name and password it's using.

If that's still no good, I would contact the vendors and ask what their app is doing.
 
Old 02-06-2009, 02:49 PM   #5
callagga
Member
 
Registered: Jan 2008
Posts: 36

Original Poster
Rep: Reputation: 15
yeah - I think I'll focus on getting feedback from the capistrano user group - it's a bit hard to isolate this to being a generic ssh issue at the moment given the variables
 
  


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
"fsck failed. Please repair manually and reboot" after chaning non-system partition undeaf SUSE / openSUSE 17 02-07-2014 12:18 PM
No longer able to log into ssh. Password right but "permission denied" Baix Linux - Software 11 11-21-2008 12:44 PM
Supplying "password" to "ssh" command paragkalra Linux - Networking 1 07-31-2008 05:19 AM
rsync over ssh - "wrong password"? yitzle Linux - Software 3 01-10-2008 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:55 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