×

This article covers how to use the chage command in Linux. In fact, With the help of chage command we can view the aging information of an account, date when the password was previously changed, set the password changing time, lock an account after certain amount of time etc

To get the  details of the password aging information use the "chage" utility with this add the option -l to display all the details

chage command Syntax is given below:

# chage  -l  <username>



This article covers methods to install Buttercup on a Linux Mint 20 system. In fact, Buttercup is a simple, yet mature and fully functional password manager. If you ever need a password manager, Buttercup may be a good option. For more details, see the site project website.



This article covers how to enable ssh passwordless login using ssh-keygen and ssh-copy-id. In fact, SSH (Secure SHELL) can be used to transfer files from one computer to another computer over the network using a secure copy (SCP) Protocol.

ssh-keygen creates the public and private keys. ssh-copy-id copies the local-host's public key to the remote-host's authorized_keys file. ssh-copy-id also assigns proper permission to the remote-host's home, ~/.ssh, and ~/.ssh/authorized_keys.



This article covers how to install and setup free version of Bitwarden for individual use. Now start saving your passwords and other confidential information in your Bitwarden vault. Using Bitwarden you can easily and safely generate, store, and secure unique passwords from any location or device. It is compliant with Privacy Shield, HIPAA, GDPR, CCPA, SOC2 and SOC3 security standards and comes with AES-256 bit encryption, salted hashing, and PBKDF2 SHA-256.


How to Install Bitwarden via Snap ?

1. Open the terminal app (ctrl+alt+t) and run below Bitwarden password manager snap installation command:

$ sudo snap install bitwarden

2. After the installation you can open Bitwarden from the application menu or via this command.

$ bitwarden

3. It also comes with a command-line support. You can install the Bitwarden command-line cli app via the below command.

$ sudo snap install bw



This article covers how to add users into the sudoers group. Also you will learn how to edit rules in the sudoers configuration file through the command. You can customize the sudoers file based on the user requirements. Sudo stands for superuser do. Sudo is a command used in Unix-like systems to allow a regular user to execute a program as another user. In most cases, it is the root user.

The sudo command allows authorized users to perform commands as another user, which is by default the root user. 

This option gives you administrator-level permissions to run programs on your machine. It is an alternative to using the su command.



This article covers Both wget and curl which are the free and open-source command-line utilities used for the non-interactive downloading of files. Remember, although both the utilities can download files from the web; they do differ a lot in terms of functionalities.

url can be used to transfer data over a number of protocols. It supports many protocols including HTTP, HTTPS, FTP, TFTP, TELNET, SCP, etc. using Curl, you can download any remote files. It supports pause and resumes functions as well.

To Install curl,

Launch command line application in Ubuntu that is Terminal by pressing the Ctrl+Alt+T key combinations. Then enter the below command to install curl with sudo:

$ sudo apt install curl



This article covers how to change own and another user account passwords. It's recommended that to change your password frequently and use a unique password for each account for security purpose. Basically, you will learn how to change a password on any Linux distribution, including Ubuntu, Debian, and CentOs.

To change a password on behalf of a user, first sign on or "su" to the "root" account. Then type, ``passwd user'' (where user is the username for the password you are changing). The system will prompt you to enter a password. Passwords do not echo to the screen when you enter them.

You can also change your own password, by typing ``passwd'' (without specifying a username). You will be prompted to enter your old password for verification, and then a new password.


How to Change a Password in Linux?

To change the password in Linux you need to open the terminal and type the following command:

$ sudo passwd

After executing the command, you will be asked to enter the new password twice. 



This article covers how to create a new SSH key pair and set up an SSH key-based authentication. You can set up same key to multiple remote hosts on CentOS system. Also, you will learn how to disable SSH password authentication.

SSH, or secure shell, is an encrypted protocol used to administer and communicate with servers. When working with a CentOS server, chances are, you will spend most of your time in a terminal session connected to your server through SSH.

SSH keys are typically configured in an authorized_keys file in . ssh subdirectory in the user's home directory. Typically a system administrator would first create a key using ssh-keygen and then install it as an authorized key on a server using the ssh-copy-id tool.

The public key should be stored in the ~/. ssh/authorized_keys file on the server.


To Create the RSA Key Pair:

1. Execute the command below to create a key pair on the client machine (usually your computer):

$ ssh-keygen

2. Press ENTER to save the key pair into the .ssh/ subdirectory in your home directory, or specify an alternate path.


Best Practices to improve SSH Key Security:

  • Discover all SSH Keys and Bring Under Active Management.
  • Ensure SSH Keys Are Associated With a Single Individual.
  • Enforce Minimal Levels of User Rights Through PoLP.
  • Stay Attentive to SSH Key Rotation.
  • Eliminate Hardcoded SSH Keys.
  • Audit All Privileged Session Activity.



This article covers how to enable and disable root user account in Ubuntu system. Considered the most privileged account on a Unix system, root can perform any tasks needed for system administration.

Navigating a specific folder, killing any process or deleting a directory, root is so powerful that it has to be managed properly.


In order to change the root password, you have to use the "passwd" and specify the root account:

$ sudo passwd root

After changing your password, the account will be automatically unlocked.

In order to switch to the root account, you can use the well-known "su" command without any arguments (the default account is root):

$ su - 


To restart your SSH server for the modifications to be taken into account:

$ sudo systemctl restart sshd



This article covers how to create a user with sudo privileges. You can now log in to your CentOS server with this user account and use sudo to run administrative commands.

Performing server administration as a non-root user is a best practice.

For security, your first task when deploying a CentOS instance is to create a non-root user with sudo access.


How to Add a New User Account on CentOS Linux System ?

1. To Create a new user account with the adduser command:

# adduser example_user

2. Set a strong password for the new user (new_user) with passwd.

# passwd new_user



This article covers how to create a user with sudo privileges. You can now log in to your Ubuntu server with this user account and use sudo to run administrative commands.

Basically, The sudo command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. 



This article covers how to force a user to change their password in any Linux Distribution.

If we create a user account with the default password, we can use this trick to force the user to change their account's default password when they first login to their account. 

This will hopefully improve the security of their account. 

We can achieve this in two ways.

1. Using passwd command

2. Using chage command



This article covers how to setup an SSH key-based authentication as well how to connect to your Linux server without entering a password.
To set up a passwordless SSH login in Linux all you need to do is to generate a public authentication key and append it to the remote hosts ~/.ssh/authorized_keys file.

To Disable SSH Password Authentication
To add an extra layer of security to your server you can disable the password authentication for SSH.
Before disabling the SSH password authentication make sure you can log in to your server without a password and the user you are logging in with has sudo privileges.
The following steps describe how to configure sudo access:
1. Log into your remote server with SSH keys, either as a user with sudo privileges or root:

# ssh sudo_user@server_ip_address

2. Open the SSH configuration file /etc/ssh/sshd_config, search for the following directives and modify as it follows:

/etc/ssh/sshd_config
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no

3. Once you are done save the file and restart the SSH service.
On Ubuntu or Debian servers, run the following command:

# sudo systemctl restart ssh

On CentOS or Fedora servers, run the following command:

# sudo systemctl restart sshd



This article covers how you can easily change the sudo password timeout by adding a single entry in the sudoers file. If you are using Vi instead of Nano, follow the instructions described here.
You use sudo for some command in the terminal, it asks for the password.

You enter the password, the command runs.
For the subsequent commands, even if they need superuser privileges, you don't need to enter the password again.
After a certain amount of time, when you try to use sudo, it asks for the password again.
It happens because there is a default timeout in Ubuntu and other Linux system for Sudo. In Ubuntu, this default sudo timeout is 15 minutes.
If you think 15 minute is too short or too long you can even change the sudo password timeout in Ubuntu.

To Change sudo password timeout in Ubuntu:
1. Open a terminal (Ctrl+Alt+T) and use the following command:

$ sudo visudo

It will open a file in nano text editor that contains some settings related to sudo.
In here look for the following line:

Defaults        env_reset

Replace above line with this one:

Defaults        env_reset, timestamp_timeout=XX

Where XX is the new timeout value in minutes.
Of course you have to replace the XX with the desired timeout value.
2. Once you are done changing the default sudo password timeout, use Ctrl+X to exit the editor.
It will give you option to save or cancel the changes.

Use Y to save the changes.



This article covers how you can change user password in Linux either graphically or using the command line. Both Linux and UNIX-like operating systems use the passwd command to change user password. 

This applies to any Linux distribution, including Alpine, Arch, Ubuntu, Debian, RHEL, Fedora, Oracle CentOS, SUSE/OpenSUSE and other popular Linux distros.

The passwd is used to update a user's authentication token (password) stored in /etc/shadow file. 


To Set User Password in Linux:

Type following passwd command to change your own password:

$ passwd


To see all user account try grep command or cat command as follows:

$ cat /etc/passwd
$ grep '^userNameHere' /etc/passwd
$ grep '^linuxapt' /etc/passwd



This article covers how to reset or change your MySQL root password on Red Hat Enterprise Linux 8.

MySQL is an open source relational database management system (RDBMS) with a client-server model for creating and managing databases based on a relational model.


To Reset the MySQL root password:

You must run the commands in the following steps as the root user. 

Therefore, you can either log in directly as the root user (which is not recommended for security reasons), or use the su or sudo commands to run the commands as the root user.

To reset the root password for MySQL, follow these steps:

1. Log in to your account using SSH.

2. Stop the MySQL server using the appropriate command for your Linux distribution:

For CentOS and Fedora, type:

$ service mysqld stop

For Debian and Ubuntu, type:

$ service mysql stop

3. Restart the MySQL server with the —skip-grant-tables option. To do this, type the following command:

$ mysqld_safe --skip-grant-tables &

4. Log into MySQL using the following command:

$ mysql

5. At the mysql> prompt, reset the password. To do this, type the following command, replacing new-password with the new root password:

UPDATE mysql.user SET Password=PASSWORD('new-password') WHERE User='root';

6. At the mysql> prompt, type the following commands:

FLUSH PRIVILEGES;
exit;

7. Stop the MySQL server using the following command.

You will be prompted to enter the new MySQL root password before the MySQL server shuts down:

$ mysqladmin -u root -p shutdown

8. Start the MySQL server normally. To do this, type the appropriate command for your Linux distribution:

For CentOS and Fedora, type:

$ service mysqld start

For Debian and Ubuntu, type:

$ service mysql start



This article covers how to password protect a file using Vim on Linux.  When password protecting a file, make sure you remember it, or else you will not be able to access your file.

You can also use a password management software if you find it difficult to remember passwords. Or visit our guide on how to install Teampass password manager on Ubuntu .

Always remember to appropriately secure text files that could contain secret info such as usernames and passwords, financial account info and so on, using strong encryption and a password.


To install VIM in Linux:

Vim is available in the repositories of most major distributions. 

So, use your distribution package manager to get installed.

For Debian based systems, use apt-get or apt package manager to install vim.

$ sudo apt-get install vim

For RHEL/CentOS based systems, use yum package manager to install vim.

$ sudo yum install vim-enhanced

For Fedora system, use dnf package manager to install vim.

$ sudo dnf install vim-enhanced

For openSUSE system, use zypper package manager to install pass.

$ sudo zypper in vim

For Arch Linux based systems, use pacman package manager to install vim.

$ sudo pacman -S vim



This article will guide you on how you can setup NFS server and client in Debian 10 system. Also, you will learn steps to install the NFS server and client, configure NFS shared directories, and mount/unmount the NFS shares on the client system.

Configuring a system to share files and directories using NFS is straightforward. 

NFS uses port 2049. NFSv3 and NFSv2 use the portmapper service on TCP or UDP port 111.

Every filesystem being exported to remote users via NFS, as well as the access rights relating to those filesystems, is located in the /etc/exports file.

To check #NFS mount #Linux:

1. Use showmount to show NFS shares.

2. Use exportfs to show NFS shares.

3. Use master export file /var/lib/nfs/etab to show NFS shares.

4. Use mount to list NFS mount points.

5. Use nfsstat to list NFS mount points.

6. Use /proc/mounts to list NFS mount points.




This article will guide you on how to use the root user on #OpenSUSE Linux and the sudo command.To use sudo, you need to install and configure sudo on the OpenSUSE #Linux server. The #sudo command allows you to run #programs with the security privileges of another user (by default, as the #superuser). Using the #sudoers file, system administrators can give certain users or groups access to some or all commands without those users having to know the root password.



In this article, you will learn how to disable password authentication for SSH including the root user. This will enable the server to only accept key based login and the root user can not login with password.




More Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on IbmiMedia.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com