How to manage passwords from the command line on Linux

With password-based authentication so prevalent online these days, you may need or already use some sort of password management tool to keep track of all the passwords you are using. There are various online or offline services or software tools for that matter, and they vary in terms of their sophistication, user interface or target […]
Continue reading…

 

How to set password policy on Linux

User account management is one of the most critical jobs of system admins. In particular, password security should be considered the top concern for any secure Linux system. In this tutorial, I will describe how to set password policy on Linux. I assume that you are using PAM (Pluggable Authentication Modules) on your Linux system, […]
Continue reading…

 

How to create an encrypted zip file on Linux

Suppose you want to create a zip archive, but with password protection, so that whoever tries to uncompress the zip file must know the right password. On Linux, there are several ways to encrypt and password protect a zip file. In this tutorial, I will describe how to create an encrypted zip file on Linux. […]
Continue reading…

 

How to manage multiple passwords on Linux

Password-based authentication is so prevalent online that you probably won’t be able to count how many passwords you are using. In fact, according to NorSIS Password Survey 2012, the average minimum number of private passwords per person is 17. Another research has found that 82% of people have forgotten their password at lease once. What […]
Continue reading…

 

How to password protect a folder or directory on Linux

Suppose you have a folder in your Linux home directory, where you store secure document files which you do not want anyone to access without a password. That way, even if someone manages to get a hold of your computer and access your home directory, there is still another line of defense for your private […]
Continue reading…

 

How to log in to MySQL server without password

In order to log in to a MySQL server, you can run mysql command along with your login credentials and server’s IP address as arguments. For example: $ mysql -u $MYSQL_ROOT -p $MYSQL_PASS -h 192.168.10.1 However, besides the inconvenience of typing extra arguments, using plain-text login credentials in a command line like above is really […]
Continue reading…

 

How to reset the root password in Debian or Ubuntu

If you forgot the root password for your Debian system, do not panic. There is an easy way to reset the password. Linux provides a special mode called “recovery mode” or “single user mode,” whereby a Linux host boots into a single user environment where you get to access shared resources such as file systems […]
Continue reading…

 

How to force login password prompt in single user mode

Linux provides so-called “single user mode” or “rescue mode” in which a multi-user Linux system boots into a single user environment with superuser privilege. The single user mode is useful when you need exclusive access to shared system resources, e.g., when conducting maintenance or security audit of root file system, and updating critical system settings […]
Continue reading…

 

How to reset root password in MySQL

If you forgot the root password in MySQL, and would like to reset it, do the following as root.  In this example, replace “NewPassword” with your own password. First create a MySQL script in /tmp/run as follows. $ sudo /etc/init.d/mysql stop $ vi /tmp/run UPDATE mysql.user SET Password=PASSWORD(‘NewPassword’) WHERE User=’root'; FLUSH PRIVILEGES; Then run mysqld_safe […]
Continue reading…