Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-06-2009, 12:07 AM
|
#1
|
Member
Registered: Jan 2008
Posts: 36
Rep:
|
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
|
|
|
02-06-2009, 02:16 PM
|
#2
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
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.
|
|
|
02-06-2009, 02:36 PM
|
#3
|
Member
Registered: Jan 2008
Posts: 36
Original Poster
Rep:
|
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).
|
|
|
02-06-2009, 02:46 PM
|
#4
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
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.
|
|
|
02-06-2009, 02:49 PM
|
#5
|
Member
Registered: Jan 2008
Posts: 36
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 04:55 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|