Tag Archives: users

Generate random passwords using Perl

If you have a server where you have to generate new passwords daily, the following script can automate the process: #!/usr/bin/perl my @alphanumeric = (‘a’..’z’, ‘A’..’Z’, 0..9); my $randpassword = join ”, map $alphanumeric[rand @alphanumeric], 0..8; print “$passwordgen\n” Run it with ./passwordgen.pl and it will generate random strings of charaters and numerals, 8 characters long:… Read More »

What group are we in?

To quickly check what group our user is in, we can use the id command. To compress the result in a more easily read output, we can use id -Gn. For example: t4l@laptop:~$ id -Gn t4l adm dialout cdrom floppy audio dip video plugdev lpadmin scanner admin