-1

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.

4

2 回答 2

4

你不能在 Perl 中真正做到这一点。http://search.cpan.org上可能有一些模块可以让你做一些不安全的事情。

我对您的建议是配置“sudo”(请参阅​​ man sudo)并使用它。

于 2012-08-09T11:26:26.007 回答
0

我要探索的另一种可能性是打开通往外壳的管道。然后你应该能够在终端上做任何你能做的事情。

于 2012-08-09T13:24:37.427 回答