Linux

Convert Ubuntu Server to authenticate with SSH key only and make user sudoer with no password

Make user Sudoer: [code] adduser ubuntu usermod -aG sudo ubuntu Edit sudoers "/etc/sudoers"password to don’t require password: %sudo ALL=(ALL) NOPASSWD: ALL [/code] Edit SSH configuration to authenticate by SSH key only: /etc/ssh/sshd_config [code] PermitEmptyPasswords yes PasswordAuthentication no [/code] “ubuntu” by DudeOmega is licensed under CC BY

Read More

How to install Varnish on CPANEL Server

Installation 1. Make Apache listen in any other port other than 80. Here I am making Apache to listen in port 8080. It can be done in two ways. Either editing the httpd.conf file or editing the Tweak settings in WHM a) Editing httpd.conf file # vi /usr/local/apache/conf/httpd.conf Locate the following line in /usr/local/apache/conf/httpd.conf file and change the port…

Read More

How to view and clear logs in Linux server

Apache and other services generate logs, that can increase the size rapidly, and could take gigabytes of the hard drive. View Log with tail Let’s supose you want to view the log located at /usr/local/apache/logs/mylog.log $tail /usr/local/apache/logs/mylog.log It will show the last lines of the log, you can also tell the command to show more lines.…

Read More

Rename files in Bash with Regular expresions

Sometimes It’s necessary to rename files following some patterns. Do this task manual is a long task, if you thousand of files. For this reason, I use rename command: Debug and preview: $ rename’REGULAR EXPRESSION’ files -n Execute: $ rename’REGULAR EXPRESSION’ files Some of the most common expressions I use are: Convert filename to lowercase:…

Read More