Linux System Administration

Change a user’s password

Price range: €18.18 through €24.12

Command:

bash
sudo passwd {username}

Explanation:

  • sudo: Runs the command with superuser privileges, which are required to change the password for another user.
  • passwd: The command used to change a user’s password.
  • {username}: The username of the account whose password you wish to change. Replace {username} with the actual username (e.g., johnalice).

Example:

To change the password for the user john, the command would be:

bash
sudo passwd john

Result:

After executing the command, you will be prompted to enter the new password for the specified user. The password will need to be confirmed by entering it again.


Additional Notes:

  • If you are changing your own password (the user you’re logged in as), you can simply use:
    bash
    passwd
  • Passwords in Linux are typically stored in an encrypted format for security.
  • Ensure the new password meets the system’s password policies (e.g., minimum length, complexity).
Select options This product has multiple variants. The options may be chosen on the product page

Mount a filesystem

Price range: €17.31 through €24.10

Command:

bash
sudo mount -t filesystem_type /dev/device_name /path/to/mount_point

Explanation:

  • sudo: Runs the command with superuser privileges, as mounting a filesystem typically requires root access.
  • mount: The command used to mount filesystems to directories.
  • -t filesystem_type: Specifies the type of filesystem (e.g., ext4ntfsvfat). Replace filesystem_type with the actual type of the filesystem you’re mounting.
  • /dev/device_name: The device you want to mount. This could be a partition (e.g., /dev/sda1) or a disk (e.g., /dev/sdb).
  • /path/to/mount_point: The directory where the filesystem will be mounted. This is the location in the filesystem where you will access the data. Replace /path/to/mount_point with the desired mount point (e.g., /mnt/data).

Example:

To mount an ext4 filesystem from the device /dev/sda1 to the /mnt/data directory, the command would be:

bash
sudo mount -t ext4 /dev/sda1 /mnt/data

Result:

This command will mount the filesystem located at /dev/sda1 to the /mnt/data directory, allowing you to access its contents via that mount point.


Additional Notes:

  • To check the status of all mounted filesystems, you can use the command:
    bash
    mount
  • If you want the filesystem to mount automatically during system startup, you will need to add an entry to the /etc/fstab file.
Select options This product has multiple variants. The options may be chosen on the product page