![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling a perl script from a perl script | new2ss | Shell Programming and Scripting | 6 | 05-24-2009 06:03 PM |
| Running script from other user rather than login user | rawatds | Shell Programming and Scripting | 3 | 01-30-2009 01:18 PM |
| How do i change to super user then revert back to ordinary user ,using shell script? | wrapster | Shell Programming and Scripting | 3 | 06-04-2008 08:11 AM |
| How to set restricted user by rksh? Cannot use Perl module DBD::Oracle | alanlh | SUN Solaris | 2 | 06-22-2007 01:10 PM |
| Perl: Run perl script in the current process | vino | Shell Programming and Scripting | 10 | 12-09-2005 10:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to scp as different user in perl script
Hi,
I am writing a perl script that needs to change to a another user and scp files to a remote server. The passwords should not be prompted but read from a config file. Please help. Thanks Sandeep |
|
||||
|
How do you plan on encrypting the config file to prevent it from being read? It seems to me that the wisest course of action might be: First, create ssh keys to allow your host to ssh into the remote host Code:
scp /source/dir/file user@hostname:</target/dir> scp -r /source/dir user@hostname:<target/dir> |
|
||||
|
Thanks. The config file storing the password will have proper permission set to avoid any other user reading it.
My main problem is, I need to scp as another user. How do I switch user and pass the password in the program. It is always prompting me for the password. Thanks |
|
||||
|
You may consider changing the UID of the person running the perl script. setuid or some such...
Visit CPAN's site and take a look at Net::SCP Net::SCP - Perl extension for secure copy protocol - search.cpan.org. It's the right way to do this... |
|
||||
|
Also, I did a quick google search for "Sending Password with scp", and ran across this site: sshpasswords[modp.com]
Here's what it had to say: Quote:
|
![]() |
| Bookmarks |
| Tags |
| perl scp change user |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|