Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SCP file transfer in Perl using UNIX login/password

Status
Not open for further replies.

zeevam

Programmer
Feb 27, 2002
11
US
I am trying to use scp to tranfer files from server a to server b. In the GUI, the user selects the file to transfer, specifies the remote server name, and enters their unix username and password. How do I code this in Perl so that the scp command is executed at the command line followed by the user's password? I also need logic that if the user enters in the wrong password that an error message will be thrown.

Here is the scp command that I run to do this:

scp $filename $login_name@$target_server:$directory

Here is the pseudocode:
if (correct login/password for the target_server){
scp filename to target_server's specified directory
enter password for user
} else {
login/password for target_server incorrect
)

Thanks,
Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top