Sftp with password


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sftp with password
# 1  
Old 10-28-2014
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 installed. I have been told that the vendor we are sending the file to does not use private/public key authentication. I KNOW that it is not a secure method of transferring files, however, I need to script an sftp transfer, using a password, without expect, lftp, or other packages. I am stuck with sftp or scp. the files that are being transferred are also in a common directory, so rsync also seems to be out as well. Really stuck here. Any suggestions would be great. beating the client or vendor for stupidity are out of the question. I have combed this forum for almost 8 hours looking for any answer.

Thanks

Last edited by mtrgoose; 10-28-2014 at 08:04 PM.. Reason: forgot something
# 2  
Old 10-28-2014
Went on this same hunt more than a year ago.
We chose to not pursue this because of it's lack of security.
The only option I came up with was using the perl module Net-SFTP-Foreign.
This User Gave Thanks to ernie For This Post:
# 3  
Old 10-28-2014
ernie, thanks for the reply. glad I am not just crazy. going to have to try and talk the customer out of this madness than.
# 4  
Old 11-03-2014
Can you not generate an SSH key pair and send them the public key? That you give you password-less login.


Robin
# 5  
Old 11-03-2014
rbatte1, I would love to use that solution, only the vendor I am working with does NOT support rsa/dsa key pair log in. funny though, they do not support ftp either. So they are forcing their client to manually upload their files, or go through HUGE hurdles to script an automated file transfer.

Thanks, Craig
# 6  
Old 11-03-2014
How do you know they don't support it? Have you tried uploading your public key to the remote machine?
# 7  
Old 11-07-2014
achenle, I know they don't support it because I have tried to upload my key, both copying it directly, and pushing the key up. Neither worked. I have also spoken the the admin of the sftp site, and he confirmed that it was now supported at this time. I don't have rights to write to the jailed root directory of my user, so am unable to create the .ssh dir, and place the authorized_key file within.

Currently, we have it as a daily task for an admin to double click a script, enter the password and let it run. a royal pain, but I haven't found another solution. I have even tried to script in powershell, and push it through our ftp server, no joy.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

SFTP without prompting password

Dear unix experts, i have a requirement as below. i need to use SFTP as FTP. ftp -n -v << ENDFTP open test_ftp.server user ftp_user_name ftp_password quit ENDFTP if i use this in a shell script, it's not asking for password. But i want the similar thing achived using... (5 Replies)
Discussion started by: AraR87
5 Replies

2. 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

3. Shell Programming and Scripting

SFTP / SCP using password

Hi, I was provided with sftp servername, user and password and the requirement is to connect to sftp server using credentials provided and drop the file. Manually i am able to connect with commands like sftp user@servername and after clicking enter, i was asked for a password and entering... (4 Replies)
Discussion started by: forums123456
4 Replies

4. 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

5. Shell Programming and Scripting

sftp password problem

Hello, trying to download data by the ksh via sftp (password protected). I am looking for the exact syntax. (I know there are 1000 of threads but I have not found anything how to add the password). ftp.XYZ.com User:ABC Passwrd:123 I tried several stuff like: sftp -b... (2 Replies)
Discussion started by: jurgen
2 Replies

6. 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

7. 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

8. Shell Programming and Scripting

SFTP using user id and password

Hi, I am using below syntax - sftp -b passwordfile userid@ipaddress passwordfile is a file, in which I have just kept a password of userid. But by this, an error is coming like - Permission denied (publickey,password,keyboard-interactive). Please suggest me on this..as I dont... (6 Replies)
Discussion started by: Monalisa
6 Replies

9. Red Hat

sftp/scp without password

Hi, I want to use sftp/scp without password.How can I do that ?? I plan to use script with scp/sftp and execute by cronjob ,any sample or example?? How can I test the scp/sftp working or not in the same user account , in the same red linux server?? any suggestion ??? (5 Replies)
Discussion started by: chuikingman
5 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