Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
No such thing as a small change
 
PerlMonks  

Re^2: Passing Password through Perl Script

by Amarendu
on Aug 09, 2012 at 10:08 UTC ( #986476=note: print w/ replies, xml ) Need Help??


in reply to Re: Passing Password through Perl Script
in thread Passing Password through Perl Script

I have a user named "hduser" and the password of the user is say "xyz123". Now I need a automated script for it so that I can get logged in as hduser without prompting for it's password. For example I have written a perl script as follows: #!/usr/bin/perl system ("su hduser && <xyz123>"); I need to set the user password for hduser. Please help urgently. Thanks a lot in advance.


Comment on Re^2: Passing Password through Perl Script
Re^3: Passing Password through Perl Script
by johngg (Abbot) on Aug 09, 2012 at 10:46 UTC

    If you want your script to run with the privileges of user "hduser" without having to enter that user's password you should probably investigate Secure Shell.

    Cheers,

    JohnGG

      That, or root privileges. (su asks no password if started as root.) But ssh is a good idea, and so would be a properly configured sudo.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986476]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2014-04-21 03:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (490 votes), past polls