SFTP in UNIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SFTP in UNIX
# 1  
Old 05-23-2011
SFTP in UNIX

I need create a Shell script to do the SFTP process. How can i provide username and password in the script.I had the below code.But it ask for password.How can i add user name and password in this code


echo "OK, starting now..."
sftp -b /dev/fd/0 testwasds3l<<EOF
cd /opt/isproj/VOM/Scripts
ascii
put /opt/isproj/VOM/Scripts/jzkvm15028_Truncate_SP_Exec
bye
EOF

# 2  
Old 05-23-2011
# 3  
Old 05-23-2011
You can put a unique username for each host you access in your ~/.ssh/config.
For example:
Code:
Host testwasds3l
    User morbid_angel

And to not have to use a password, copy your ~/.ssh/id_dsa.pub file (which contains one very long line) to the other host in file ~/.ssh/authorized_keys. Append it to the end if it exists or create it. Make sure to set the file permissions to 600 so only you can read it.

Then if you install the keychain software package you can be prompted once for your key passphrase on the first boot after login and have automatic passwordless access to the other machine. Security is provided by the requirement to login to the first machine.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP error in UNIX

I have this code snippet: sftp $USERNAME@$REMOTE_SERVER -omode=ascii >> $LOG_FILEPATH/$LOG_FILENAME 2>&1 ls /+showall ls /+... (11 Replies)
Discussion started by: Jesshelle David
11 Replies

2. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

3. UNIX for Dummies Questions & Answers

Sftp from UNIX to mainframe

Hi, I have many scripts where i have used sftp for file transfer from unix box to unix box.. Now that we have to sftp files from unix to mainframe, i would like to know if that is possible. I just tried in the same way i did from unix to unix, but i got the error as connection refused. Are... (2 Replies)
Discussion started by: dnat
2 Replies

4. Shell Programming and Scripting

sftp to UNIX host

Hi, I am writing a shell script that securely connects to an UNIX host and transfer file(abc.txt) from the local machine to the host. sftp user@host get abc.txt bye The code doesn't work.. It throws error at line 2: get :Unknown get command. How can I rectify this problem? (2 Replies)
Discussion started by: Kishore_1
2 Replies

5. Shell Programming and Scripting

SFTP from Unix to Windows

Hi all Not sure where I should be posting this so apologies if it's in the wrong section. I'm trying to set up a system where we can copy a file (get) from a Windows server to a Unix server using SFTP in an automated way. I've installed CoreFTP Server on the Windows server and can connect... (2 Replies)
Discussion started by: huskie69
2 Replies

6. Linux

SFTP on SCO Unix

Hi, I have a request to install sftp on the Sco Unix Server. Request you please let me know the process for the installation of SFTP on Sco Unix Server. Thanks & Regards Arun (2 Replies)
Discussion started by: Arun.Kakarla
2 Replies

7. UNIX for Dummies Questions & Answers

SFTP VMS to UNIX

All I am a VMS guy just learning UNIX. My first task is to SFTP files from VMS to UNIX in BATCHMODE without having to enter a password. Note that using SFTP interactively works just fine. I have followed some specific instructions provided by a vendor with no success. I have also read... (0 Replies)
Discussion started by: randyhouse
0 Replies

8. UNIX for Dummies Questions & Answers

UNIX sftp from mainframe

I have the following UNIX script which copies a file from a UNIX server in Canada to a UNIX server in the UK. LOG=/data/proj/sftp/canada.log DAT=`date "+%d/%m/%y %H:%M"` HOMEDIR=/data/proj/sftp TGTFILE=P_DATA.csv cd $HOMEDIR echo "\nStarting retrieval of Canadian Data at $DAT" >> $LOG ... (1 Reply)
Discussion started by: mishnok
1 Replies

9. Shell Programming and Scripting

sftp using authorized_keys in unix

I am creating public and private key for sftp in ksh. then copy the name1.pub file into /.ssh/authorized_keys directory in remote server. Now my question is how to write that script which do not ask me for the password from prompt. please help. thanks in advance. (1 Reply)
Discussion started by: rinku
1 Replies

10. HP-UX

sftp from unix to NT

Hi, 1) I want help on SFTP,Some commands not working in SFTP,but working in FTP example: bin,ls -xt ,user. Any alternate methos for this 2) if I want download files from UNIX to NT,I am able to download,but file format not connverting according to UNIX format(in NT end of line \n,but in... (1 Reply)
Discussion started by: anthonykomma
1 Replies
Login or Register to Ask a Question