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 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…