Re: OpenSSH question : password prompt when scripting



If I had to guess, I'd say that somehow the shell script is running as a
different user than the command line example.

Have you setup your public / private key exchange with a passphrase, or
without? Assuming you are user "pearson" in the first example, if that
session has an ssh-agent running and has set the:
SSH_AUTH_SOCK and SSH_AGENT_PID environment variables, those will not
carry over to the shell script. In that case, you would be prompted for
your passphrase instead of your password, so that may not be the
problem.

Questions:
Are you user pearson in the first example?
Does your shell script only contain the line: sftp
geles@xxxxxxxxxxxxxxxxxxxxxxx?





-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@xxxxxxxxxxxxx] On Behalf
Of
Yard, John
Sent: Wednesday, June 14, 2006 11:39 AM
To: aix-l@xxxxxxxxxxxxx
Subject: OpenSSH question : password prompt when scripting

On AIX 5.1 , using openssh, running as a user
I can do a key exchange, and will not be prompted
for a password :

$ sftp geles@xxxxxxxxxxxxxxxxxxxxxxx
Connecting to xxxasaprdftp.nc.ncs.com...
sftp> quit
$

But if I run the exact same command as a script,
it prompts me for a password:

[viper:/usr/local/bin] # su - pearson -c /usr/local/bin/get_Pearson
Connecting to xxxasaprdftp.nc.ncs.com...
gesles@xxxxxxxxxxxxxxxxxxxxxxx's password:


Has anyone seen this behavior in scripted sftp sessions ?

JYard
UCLA



Relevant Pages