Linux

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); m[...]


What user accounts have I created in Linux?

To quickly find out what user accounts you have created in your Linux system, use cut -d: -f1 /etc/passwd | sort This will output the list of usernames from /etc/passwd in a nice and readable way. [...]


Change file ownership and access permissions with one command

You can change the file permissions and ownership, the group and mode of a directory with a single command, using chown. For example, to make a directory called /dir accessible for everyone (RW), set the user joe as the [...]


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 vide[...]