SFTP - Pass password auti

ftp -i -n <<HERE
open $IPADD
user $USRNAME $PASS
cd /
get $FNAME
close
quit
HERE

Hi all the above script i used for ftp. How to modify same for sftp?
thanks in advance

It's sun 9. When i am trying for sftp it's asking for password, thats should generate through script.

Please help me guys.

Read This:
How can I automate an SFTP transfer between two servers? - Ask Leo!

I seem to think that batch sftp wants authentication to have already been done and doesn't expect to see passwords in scripts.

Its probably possible to get round this by not letting sftp know that there isn't someone actually typing stuff in. There are several possible methods - have a look at screen, tcl/expect or even kermit which all should allow you to fake an interactive session with sftp or indeed any command line program which is awkward about accepting input from a redirected file.

Hi all,

I have a list of serves and password for those...! but i am FTP is disabled on thoses servers. Is that there is no way of providing password for those servers....? via script... plz could some one help me out...?

Since FTP is disabled, you'll need to do some work in preparing sftp connections to each of the servers you wish to connect to ... manually.
After you've finished establishing connections, you then need to port your public key to each of the same servers.

After that you need to use something similar to the followig shown in this link.

HTH's

Cheers,
Cameron

Hi All,

Looks every time when i as for a solution guys come with the ssh private key concept.

But what i want is i need to edit my existing script which was working very well for FTP. Since FTP is disbaled on few servers, i want to edit the existing script for SFTP

when ever i am using sftp i am geting a login screen, i want this to be automated.

Come on friends... I need ur Help..! any one....? :confused:

*Sigh ...

Your new SFTP batch file will contain the following...
cd /
get $FNAME
exit

The ssh private key concept is part of your solution - removes the need for UID/PWD with each connection. You'll be able to figure the rest now. If you get stuck - use the search facility against the forum.

Cheers,
Cameron

Hi Solaris experts...

Just i want to sftp to N no of servers and get one file. So i need a script for that.

OS: Solaris 9

I writen a script before for ftp, but when i am trying for sftp i am geting login screen again, just i need to aumate by prviding passwd through script.

My previous script
--------------------

ftp -i -n <<HERE
open $IPADD
user $USRNAME $PASS
cd /
get $FNAME
close
quit
HERE

I have all the server ipaddress,username,password and the file name too

Still i am unable to perform sftp script.

when i am trying sftp $USRNAME@$IPADD

it's giveing me a password prompt -> How can provide a password through script?

Looking from long time... Please guys some one help...! i have more than 100 servers where i need to do manualy.

I will very thankful to you all.

Any one can help me for above ques?

From my simplistic knowledge of sftp and if memory serves me correctly ... sftp does Not Allow the ability to "script" passwords into it.

If it were to do so, it would contradict proper security protocol's, which is why you are prompted for a password.

To avoid the requirement of passwords is to establish a trust between the two respective hosts using the Public Key to identify & confirm the hosts is whom it says it is. This is why we've highlighted the private key concept. :rolleyes:

Just remember that standard ftp is unsecured, hence why you're able to script passwords into it so easily.

If this task is to be a unique - once off task, then suggestively - do it manually. Have a jiunior admin do it if you really must. Otherwise move forward with your task.

Cheers.....