Specify password in SFTP command


 
Thread Tools Search this Thread
Special Forums Cybersecurity Specify password in SFTP command
# 1  
Old 10-09-2008
Specify password in SFTP command

Hi,

How can I specify a password on the scp command line so that it should not prompt for the password?

Shabu
# 2  
Old 10-09-2008
try something like this
Code:
scp filename user@passwd:/path

# 3  
Old 10-10-2008
Tried it

Hi,

I am able to copy to the destination mahine without any problem. But each and everytime it's asking for the password. I want to schedule job so that it can copy a file to the destination machine without anyones intervention.

shabu
# 4  
Old 10-10-2008
set up ssh keys for the user that will run the script.
a quick search on google for "ssh passwordless connection" will show you how.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sftp with password

I have been tasked with scripting a sftp transfer from my clients sftp server to a vendor. I have been given a user name and password. This is an older OEL server, 5.2. I am not able to install any packages on this system. It does not have expect, ssh-pass, or any other ssh password helper... (6 Replies)
Discussion started by: mtrgoose
6 Replies

2. HP-UX

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... (1 Reply)
Discussion started by: ketanraut
1 Replies

3. Shell Programming and Scripting

SFTP prompting for password even though password is in script

Hi All, I am trying to transfer a file from one server to a remote server using SFTP. Client is not ready for key setup. I am working on Solaris 10. Here is the code. #!/bin/ksh # sample automatic Sftp script to dump a file USER="user1" PASSWORD="pass1" HOST="host1" sftp $USER@$HOST... (6 Replies)
Discussion started by: megha2525
6 Replies

4. Shell Programming and Scripting

In put password automatically to sftp command

Hi all, i have to sftp a file to another server I don't have "expect" or sshpass on my machine its solaris 10, i want to pass password in command line or after doing this sftp user@server how to automatically provide the password as input ( stored in some variable or so) ... (1 Reply)
Discussion started by: zozoo
1 Replies

5. Shell Programming and Scripting

SFTP with Password

Hi Guys, I need to know how can i achieve SFTP "with" password in a shell script. I have already done passwordless key generation thing and it is working but at the moment i am interested in passing a password. And another question I have is say i have a.ksh and b.sh scripts...Can i invoke... (6 Replies)
Discussion started by: Arpit Narula
6 Replies

6. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

7. Shell Programming and Scripting

sftp is asking password

Hi i have generate public private key pair using command ssh-keygen -t rsa -b 2048 and then it made the two keys under the directory ~/.ssh ( in server 1) one is public key and another one is private .. i copied public one key onto my second server under the directory ... (22 Replies)
Discussion started by: aishsimplesweet
22 Replies

8. Shell Programming and Scripting

password - SFTP

Hi team, I know if we need to transfer the files between between 2 servser, we use SFTP through key setup between 2 server. currently There are some problems and we are not able to setup keys between servers. How can i use password with SFTP for temporary solutions, so that the file... (6 Replies)
Discussion started by: Amit.Sagpariya
6 Replies

9. UNIX for Advanced & Expert Users

How to use SFTP from command line without entering user and password

I would like to use SFTP from command line without entering userid and password. Here is what I have gathered and did. 1) Create a public and private key pair for the protocol you want to use. To create a key pair for use by SSH2, enter: ssh-keygen -t dsa I did that and got... (7 Replies)
Discussion started by: Hangman2
7 Replies

10. Shell Programming and Scripting

SFTP password automation

I am working on a script to automate and SFTP that I am currently doing to a company that does not allow for a .ssh profile to be created. I have search and read about the -b option and am wondering if i can get some more information about it. I tried to right a file containing the password... (3 Replies)
Discussion started by: jaycheetwood
3 Replies
Login or Register to Ask a Question