Here is a quick script to rewrite a passwd file to enable shell access for a given user. my $user = $someuser; my $found_user; my $passwd_path = "/etc/passwd"; open(my $fh_pw, "<", $passwd_path) or die "can’t open $passwd_path: $!\n"; open(my $fh_pw_w, ">", "$passwd_path.temp") or die "can’t open $passwd_path.temp: $!\n"; while (<$fh_pw>) { my $cur_line = $_; [...]
-
Pages
Categories
