Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sftp and passwords

Status
Not open for further replies.

tbohon

Programmer
Apr 20, 2000
293
US
From an AIX box I'm trying to connect to a remote server to drop some files. I've never used sftp before and am having problems which I don't find addressed in the manpage or in this forum.

Here's the situation ...

If this were a regular ftp script I’d do something like this:
Code:
ftp –n xxx.xxx.xxx.xxx << EOF
user xxx <password>
ascii
prompt
cd …..
mput
quit
EOF
In sftp I can’t make it either ignore the password (which I thought was the purpose of the keys we previously generated and sent to the remote system administrator) or read that password from a batch file as follows (from the man page):
Code:
sftp –b <batfilename> user@IPaddress
where <batfilename> contains the following:
Code:
<password>
ascii
prompt
cd …
mput
quit
It continues to ask for the password before reading the batch file and then reads the password from the file as a command and promptly aborts.

I've read the manpage, searched this forum and done a preliminary search on the internet without finding a solution.

Thanks in advance for any assistance.

Tom


"My mind is like a steel whatchamacallit ...
 
May you ssh the foreign host with no password prompt ?
If it's not the case :
man ssh-keygen

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
We think there is a key installation error and are working that now - everyone with whom I've spoken, both here and at the remote system, seems to agree. I think the plan is to remove the keys and reinstall them, then test.

Thanks!

Tom

"My mind is like a steel whatchamacallit ...
 
Any reason why you aren't using scp? That way you don't need to create any batch file of commands.

Incidentally, prompt, ascii and mput are FTP commands only, I don't believe they are available in sftp.

Annihilannic.
 
I had massive problems when I first installed keys for ssh/sftp/scp. Nine times out of ten it was permissions on home directories, which need to be quite tight for it to work. Other problems we had were with the accounts on the remote end being disabled, locked or similar.

Ceci n'est pas une signature
Columb Healy
 
Issue has been corrected and I'm not connecting to the remote server. Turned out to be a configuration error on his end - once that was straightened out (by deleting and then reinstalling my keys) it's up and running.

Thanks all!

Tom

"My mind is like a steel whatchamacallit ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top