VIKHOST Tech Blog
Useful Technical Articles, Notes and Instructions.
How to find out the external ip in Linux

How to find out the external ip in Linux

How to find out the external ip in Linux — If you need to find out external IP from Linux command line, you need to do one of next commands: How to find out the Public IP Address from the Linux Command Line You need to get external IP address using command curl: # curl ifconfig.me
# curl ip.appspot.com
# curl icanhazip.com How to get external IP using command wget: ...
Read more
Generating Random Passwords from the Command Line in Linux

Generating Random Passwords from the Command Line in Linux

Generating Random Passwords from the Command Line in Linux — You can use next command for generating random password in command line: # tr -dc A-Za-z0-9 < /dev/urandom | head -c 8 | xargs Password example: 4fFUND1d Also you can use next bash function (add it to yuor ~/.bashrc): Random Password Generator genpasswd() {
tr -dc A-Za-z0-9 < /dev/urandom | head -c ${1:-8} | xargs
} Reboot .bashrc: $ . ~/.bashrc Now use genpasswd to generate random passwords: $ genpasswd
vmuWt7TS
$ genpasswd 10
ymkIgxcdCh
$ genpasswd 16
wQnqgdc5tAQoiBdf ...
Read more
How to Clear BASH History in Linux, Centos, Debian and Ubuntu

How to Clear BASH History in Linux, Centos, Debian and Ubuntu

How to Clear BASH History in Linux, Centos, Debian and Ubuntu — If you don’t want to save history in Bash, since the commands may contain data such as passwords. This article will help keep Bash history in check. How to completely delete the Bash history: -c - Clear history file -w - add commands of the current session to the history file # history –cw How to remove a ...
Read more
How To Clear or Remove Linux Logins History

How To Clear or Remove Linux Logins History

How To Clear or Remove Linux Logins History — On Linux systems, there are three standard commands that show information about the most recently connected users: last, lastb and lastlog. The output of these commands includes: login, time of last connection , IP address, port, etc. To preserve anonymity, it is necessary to clear the history of recent connections.
Command Log Description last /var/log/wtmp Lists successful login/logout history lastb /var/log/btmp ...
Read more
How to Find the Largest Files in Linux

How to Find the Largest Files in Linux

How to Find the Largest Files in Linux — The search for large files is especially relevant when the disk runs out of space and you have to look for files to delete. The best way to find all the largest files on a Linux server is to use the command line. You can easily get a list of the largest files using a combination of several simple commands. How ...
Read more
MySQL Server-Create New User and Grant Permissions

MySQL Server-Create New User and Grant Permissions

Create New User and Grant Permissions to MySQL database server In this article, we will explain how to create a new user in MySQL, and grant permissions to that user in MySQL. Creating a new user in MySQL database and granting permissions is an easy task if you follow this tutorial carefully. 1. Log in to MySQL To log in to MySQL system uses the following command: mysql -u root ...
Read more
MySQL Server-Enable Remote Access

MySQL Server-Enable Remote Access

Enable remote access to MySQL database server If you try to connect to server mysql from remote server, you will get an error. Initially, mysql uses the standard localhost connection (127.0.0.1). It needs to be fixed this in the configuration file my.cnf (usually in Linux the file is located /etc/mysql/my.cnf) In my.cnf we need to find line: bind-address = 127.0.0.1 It needs to be changed to: bind-address = 0.0.0.0 Now ...
Read more
Loading...