automatic scp download (without the use of ssh keys)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting automatic scp download (without the use of ssh keys)
# 1  
Old 07-28-2008
automatic scp download (without the use of ssh keys)

Hi guys,

I need to automate scp downloads from a server to which I do not have the ability to upload my public key for automatic logins.

I know there is something called expect, but I wasn't sure if that was the best way to go. Basically I am executing a scp download command and I need the script to watch for the password prompt and enter it for me. A level up would be reading the password from at least somehow encrypted form (either within the script itself or a local file)

any tips & tricks appreciated
# 2  
Old 07-29-2008
Use expect, it's much more flexible than any other solution, at least that's my opinion. There are implementations in Perl and Python, or the original TCL one.
The most easiest way, however, is to use "autoexpect" - it will record whatever you do, and will generate expect script, which you can run or modify later.
# 3  
Old 08-06-2008
thank you for the reply.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find active SSH servers w/ ssh keys on LAN

Hi, I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step: #!/bin/bash # LAN SSH KEYS DISCOVERY SCRIPT </etc/passwd \ grep /bin/bash | cut -d: -f6 | sudo xargs -i -- sh -c ' && cat... (11 Replies)
Discussion started by: syrius
11 Replies

2. Shell Programming and Scripting

Automatic scp Script

I need a script to automatically scp the latest files on DIR1,DIR2 and DIR3 from Source to destination server at same place(DIR1,DIR2 and DIR3) . Further details are: Source Server (192.168.1.5) DIR1 DIR2 DIR3 Destination Server (192.168.1.10) DIR1 DIR2 DIR3 (7 Replies)
Discussion started by: refra
7 Replies

3. Shell Programming and Scripting

SFTP or scp with password in a batch script without using SSH keys and expect script

Dear All, I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
Discussion started by: ss112233
5 Replies

4. Shell Programming and Scripting

What are public keys in ssh and how do we create the public keys??

Hi All, I am having knowledge on some basics of ssh and wanted to know what are the public keys and how can we create and implement it in connecting server. Please provide the information for the above, it would be helpful for me. Thanks, Ravindra (1 Reply)
Discussion started by: ravi3cha
1 Replies

5. Cybersecurity

automatic SCP transfers issues

Hi, I'm trying to set up scp but it isn't as nice as WinSCP. My requirement is to transfer a file from one machine to another with scp. This would run in a .ksh so it would need to avoid prompts (password/are you sure). First I tried this with v2: SSH with Keys HOWTO: SSH with Keys in a console... (1 Reply)
Discussion started by: Dird
1 Replies

6. Shell Programming and Scripting

Automatic FTP-Download | not files older then x days

Hey Guys, i need to download files from a ftp-server that not older than $VAR (x) days eg for seven days ./script 7 or two weeks ./script 14 all files from the last 14 days will download but how i can explain "ftp" this? sorry for my strange english :/ (2 Replies)
Discussion started by: tetex
2 Replies

7. Shell Programming and Scripting

Automatic download of csv file using a shell script

I want to automatically download a CSV file daily which can be found here: http://www.londonstockexchange.com/en-gb/pricesnews/prices/coveredwarrants/search.htm and the link is named "Click to download covered warrants (100Kb)" onthe right hand side. What commands can I use to invoke clicking... (1 Reply)
Discussion started by: figaro
1 Replies

8. Shell Programming and Scripting

automatic transfering of files using scp

I'm in the process of writing a shell script with copies files from one linux box to another using scp. I wish to run this through a cronjob so it cannot be interactive. This is what I have so far. #!/bin/sh PASSWD='passswd' dateset=$( date | awk '{print $2 $3 $6}') for dates in $dateset;... (1 Reply)
Discussion started by: tcruicksh
1 Replies

9. UNIX for Advanced & Expert Users

SSH Keys Help

Hello, I'm wondering if anyone has a step-by-step instruction set for setting up ssh keys? I've gone through many of the manuals online (most seem to be from the same source) and it's a little bit unclear when the documentation is talking about the server versus the client machine. I'm missing... (1 Reply)
Discussion started by: sysera
1 Replies
Login or Register to Ask a Question