SFTP & Passphrase('s)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SFTP & Passphrase('s)
# 1  
Old 05-26-2008
SFTP & Passphrase('s)

Hi all,

I generally use the something along the lines of the following when I need to perform SFTP's ...
Code:
  sftp -v -o IdentityFile=${IdentityFile} \
       -b ${SFTP_BATCH_FILE} \
       ${USRID}@${IP_OR_DNS}:${REMOTE_DIR} 2>&1 | tee -a ${SFTPLOG}

Now currently we are not using any passphrase against our key-pair when generated. However, if I am forced down that path because of security requirements; can I still automate the SFTP transfers without user interaction??

I'm running HPUX-11.23, but have not been able to identify and option/parameter that I could use to facilitate the passphrase.

Any assistance really appreciated.

Cheers,
Cameron
# 2  
Old 05-27-2008
Especially for HP-UX's version of SFTP I'm not sure there is a command line option, consider using expect with passing the password from a script (though it's but insecure to store password in plain file), search the forum for SSH expect scripts.
# 3  
Old 05-27-2008
Thanks for responding sysgate.
It's something that I'm hoping will not become a reality, but some 'people' here have mentioned that it might with providing a clear reason why. Our current setup (example above) has been working without issue for sometime. Not sure if they're trying to take a lend of me - but they're the supposed security experts and if it turns out that I've wasted time and resources my boss has promised to take strips of them ;-)

Not played with expect before & thanks for the keyword.

Cheers,
Cameron
# 4  
Old 05-27-2008
Hello Cameron,

we have running a hp-ux box and there is one user which uses passphrase authentification. Try to make a .ssh2 directory in users home on the target box. Store there the id_dsa.pub, may you have to use ssh from ssh.com, and put a file .ssh2/authorization
In the authorization file, you put in which key to use.

root@hp-ux: / # cat authorization
Key id_dsa.pub

I hope this solves your question.

Regards,

Frank
# 5  
Old 05-27-2008
Hi Frank,

Thanks too for your reply.
I should qualify some of what I've mentioned earlier.
Any existing ssh/sftp configurations are to remain as is.
All new ssh/sftp configurations are "apparently" to use the additional passphrase security.
And this will initially be for a Windows setup running WinSSHD with Virtual Accounts established.
Which I've only just set up & have a number of accounts working presently.

I'll reread up on the ssh pages to see what is mentioned regarding dsa keys and their use.

Again, many thanks Frank for the mention. Smilie

Cheers,
Cameron

Last edited by Cameron; 05-27-2008 at 10:22 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies

2. UNIX for Advanced & Expert Users

Passphrase Complexity

Hi, How to configure minimum passphrase (Not UNIX password) requirements on any UNIX box? Passphrase - the one user enteres while generating pub/pvt keys using ssh-keygen. Thanks! Reddy (3 Replies)
Discussion started by: reddyr
3 Replies

3. Solaris

SSH & SFTP Chroot

Hello all, does anybody knows a procedure to enable an chroot for users using ssh and sftp ? Thanks (1 Reply)
Discussion started by: celord
1 Replies

4. Shell Programming and Scripting

sftp + expect: disconnection & restart removes already transfered data.

I have an ftp statement that when it restarts, it will write over the top of the file at the other end, rather than append to the file part sitting at the destination. This is a problem because the flaky connection fails so regularly that the 2GB file I try to transfer will never complete. ... (2 Replies)
Discussion started by: rupert160
2 Replies

5. AIX

sftp between Unix & windows

Guys, sftp between Unix & Windows I'd like to get good software or a way to how to configure sftp between ( windows to Unix ) and ( Unix to windows ) to be automatic login between the different operating systems without asking password .. Pls assist in this regard … (3 Replies)
Discussion started by: Mr.AIX
3 Replies

6. Shell Programming and Scripting

File locking (Unix/Linux) & sftp

Hi all, Can anyone help ...on how to ensure that a file is locked . thanks & regards, Soodoo ---------------------------------------- Problem description: - We usually use the mv command in scripts to make sure that a file is complete and not being written to by another process. ... (1 Reply)
Discussion started by: soodoo
1 Replies

7. Shell Programming and Scripting

sftp Connection from Unix to Windows 2003 server using Passphrase

Hi All, I am trying to connect from Unix machine to Windows 2003 server using passphrase method. It is connecting to the server and the connection is immediately closing. Below is the stack trace. Can anyone let me know what wrong with it? cwadmin@iut1wps1:/home/cwadmin> ssh username@targetip... (1 Reply)
Discussion started by: vijayin
1 Replies

8. UNIX for Advanced & Expert Users

SFTP automation with password/passphrase

Hi All, We have a special requirement from our client, we need to automate one of the sftp job with password authentication. I know sftp can be automated with Key authentication, but this is not what I am looking for. Can some body help me, a method like .netrc in FTP automation or like sftp... (6 Replies)
Discussion started by: shihabvk
6 Replies

9. Shell Programming and Scripting

SFTP - non-interactive - using passphrase

Hi, I have written a script that does SFTP successfully without using the password (Thanks to this site :b: ) and it works fine. The thing is - this script uses the public and private key generation with a "null" passphrase. But I now need to write a script that does SFTP non-interactively... (1 Reply)
Discussion started by: sandy0077
1 Replies

10. UNIX for Dummies Questions & Answers

ssh2 & sftp help

Hi, I need to implement sftp between server 1 and server2. I have already generated the public key using account user1 on server 1 and and sent it to the administrator of server2. I have also finished updating the identification file at /home/user1/.ssh2 I have an account created... (11 Replies)
Discussion started by: tansha
11 Replies
Login or Register to Ask a Question