Home » Infrastructure » Unix » sftp password
sftp password [message #98489] Wed, 24 November 2004 05:58 Go to next message
sidd
Messages: 130
Registered: May 2003
Senior Member
i need to write a small korn shell script to sftp a file, i know how to do interactively, i need to automate those commands including password, the problem i am having is with password, how can i stop sftp from prompting for password.

thanks
Re: sftp password [message #132096 is a reply to message #98489] Wed, 10 August 2005 16:39 Go to previous messageGo to next message
rmankoe
Messages: 4
Registered: August 2005
Junior Member
I have the problem. Any solutions yet?

Regards,
Ram
Re: sftp password [message #132219 is a reply to message #132096] Thu, 11 August 2005 07:08 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
did you try sftp in batch mode? Look into the docs.
man sftp will give you the options.


-b batchfile
Batch mode reads a series of commands from an input batchfile
instead of stdin. Since it lacks user interaction it should be
used in conjunction with non-interactive authentication. sftp
will abort if any of the following commands fail: get, put,
rename, ln, rm, mkdir, chdir, ls, lchdir, chmod, chown, chgrp,
lpwd and lmkdir. Termination on error can be suppressed on a
command by command basis by prefixing the command with a ?-?
character (For example, -rm /tmp/blah* ).

Re: sftp password [message #132229 is a reply to message #132219] Thu, 11 August 2005 08:12 Go to previous messageGo to next message
rmankoe
Messages: 4
Registered: August 2005
Junior Member
thanks for your reply.

i used public-key authentication method (OpenSSH) as described at
http://www.networknewz.com/networknewz-10-20030707AuthenticatingbyPublicKeyOpenSSH.html
Now i can use sftp without prompting for password.

Regards,
Ram
Re: sftp password [message #229155 is a reply to message #132229] Thu, 05 April 2007 10:06 Go to previous messageGo to next message
etar1017
Messages: 2
Registered: April 2007
Junior Member
Ram,

I have a similar problem and trying to connect sftp without password.
I created public key and copy to remote server.
When I am trying to connect using sftp it is still prompting to password.
Please advice.

Thank you,
Eric.
Re: sftp password [message #229167 is a reply to message #98489] Thu, 05 April 2007 11:07 Go to previous messageGo to next message
etar1017
Messages: 2
Registered: April 2007
Junior Member
Hello,

I have a similar problem.
Do you know the solution?

Thanks.
Re: sftp password [message #232983 is a reply to message #229167] Tue, 24 April 2007 06:26 Go to previous messageGo to next message
avdhesh
Messages: 4
Registered: March 2002
Junior Member
Hi,
I want to redirect a sql script to another server mean want to ftp it to another server.My script is below but it's not working.
Please help me

#! /bin/sh
export ORACLE_USER=apps
export ORACLE_PASSWORD=sma1db07
export DB_NAME=SMAXDEVL

export CONNSTRING=${ORACLE_USER}/${ORACLE_PASSWORD}@${DB_NAME}

$ORACLE_HOME/bin/sqlplus -s $CONNSTRING <<!

@sf1.sql >>/tmp/sf.txt

#exit;
#EOF

ftp 10.32.25.73
bin
put /tmp/sf.txt
bye
EOF
Re: sftp password [message #263666 is a reply to message #98489] Thu, 30 August 2007 12:49 Go to previous messageGo to next message
putty_02
Messages: 1
Registered: August 2007
Junior Member
Is there a way to do this without using public keys? I need the ability to automate sftp from A to B, but I do not have permission to use public keys on B.
Re: sftp password [message #263707 is a reply to message #98489] Thu, 30 August 2007 17:08 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
use "expect" utility & hardcode password as answer.

Yes, it is NOT a secure solution.
Pick your poison.
Re: sftp password [message #264090 is a reply to message #263707] Fri, 31 August 2007 13:50 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
-- try this FTP lookalike
http://www.chrispoole.co.uk/apps/xutlftp.htm

-- the regular utl_ftp for interest...
http://technology.amis.nl/blog/?p=1247
Previous Topic: need to display sql messages to screen when running from unix shell
Next Topic: need help
Goto Forum:
  


Current Time: Wed Apr 24 01:09:58 CDT 2024