Connect to remote server using sftp with password define within command/script


 
Thread Tools Search this Thread
Operating Systems HP-UX Connect to remote server using sftp with password define within command/script
# 1  
Old 01-30-2014
HP Connect to remote server using sftp with password define within command/script

I am trying to connect to remote server in hp-ux, using sftp command (using sftp username@ip and password ) able to connect to remote server but, in this case sftp prompt for password and user need to manually enter it.
I want sftp can read a password define in script or from file, so it can remotely fetch data from server without asking for password.

NOTE:- with my server no public private key define, no export command works, even sudo is not define

Facing error with -password option in sftp

Code:
sftp --password="password" "userid"@"servername"

ksh: 8: parameter not set

Please suggest is there any optional command i can use to do the same.
In any case command/script should not prompt for password and get the data from remote server.even perl script is ok for me..Smilie
# 2  
Old 01-30-2014
"interactive password authentication" means "password typed by a human being in realtime authentication" -- no substitutes for human are acceptable when a plaintext password is involved. sftp is designed to prevent what you are trying to do, because what you are trying to do is a very bad idea. It's nearly impossible to keep stored plaintext passwords safe. Passing it in as --password, for example, would proudly display your password to every user on the system...

You say public/private keys do not work? Take a look at file permissions in ~/.ssh/, ssh is very particular about them. Also try ssh -v -v to get a closer look at where it decides to give up. (ssh/scp/sftp are all the same protocol fundamentally.)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. AIX

Command to connect to remote AIX server

Hi All, Im looking for a command that can remotely connect to another AIX machine and execute scripts present in that server(Possible scenarios are a complete a restart of 3 servers in a cluster through a single script execution present in one of the servers). Im relatively new to AIX and... (5 Replies)
Discussion started by: Vishakh
5 Replies

3. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

4. Shell Programming and Scripting

[SSH] Need to connect to remote server as different user and without password

I have a task requiring that USER_A run a script, which connects to HOST_B as USER_B and does not ask for a password. If I am logged in on HOST_A as USER_B, I can connect to HOST_B without a password, no problem. However, if I try running ssh with the command line "ssh USER_B@HOST_B" while... (3 Replies)
Discussion started by: Totengraber
3 Replies

5. Shell Programming and Scripting

Script to connect to a remote server and execute scripts

Hello All I need a script or set of commands which can establish a remote connection with another server and execute some scripts over there. Basically it has to establish the connection with the remote server as an user ,say 'testuser' and then execute the script 'testscript'. and return the... (5 Replies)
Discussion started by: sgbhat
5 Replies

6. Shell Programming and Scripting

connect to remote server by applying password

Hi , I am new to shell script. I have to write a shell script which will login to remote server then check for the space there. There 50 remote ervers all are having different password. Could you please suggest me some way. I am working on solaris box. Thanks in advance (2 Replies)
Discussion started by: vikash_k
2 Replies

7. Shell Programming and Scripting

shell script for how to connect to a remote server by using ssh

i want to connect to a remote server through ssh. i have to also provide password within that script. after connecting to the remote server i want to do some operations like grep,cd etc can u pls help me to wite a script. Thanks (1 Reply)
Discussion started by: millan
1 Replies

8. Shell Programming and Scripting

how to connect sftp server using script

Hi friend I have a command: sftp -v dtxsttp90102@dtx.us.dell.com I need to connect sftp server using above command and grep for some files and need to back to script can anyone tell me how to write script connectingSFTP.sh -------------------- sftpCmd=`sftp -v... (1 Reply)
Discussion started by: kittusri9
1 Replies

9. Shell Programming and Scripting

Connect to a Remote Sybase Server Through Script

Hi all, I am trying to connect to Remote Sybase database Server through shell script. I am operating on WindowsXP, connect to Unix(version SunOS: 5.8) The thing is i dont know how to connect to Sybase Server through my script file? Are there any manual pages which can guide me through the... (3 Replies)
Discussion started by: Aparna_k82
3 Replies

10. Windows & DOS: Issues & Discussions

Connect to a Remote Sybase Server Through Script.

Hi all, I am trying to connect to Remote Sybase database Server through shell script. I am operating on WindowsXP, connect to Unix(version SunOS: 5.8) The thing is i dont know how to connect to Sybase Server through my script file? Are there any manual pages which can guide me through the... (2 Replies)
Discussion started by: Aparna_k82
2 Replies
Login or Register to Ask a Question