Change your SSH server port to reduce brute force attacks

Reduce SSH brute force attacks by changing your default SSH server (sshd) port from port 22 to a different one. Below is a sshd log example of a brute force attacks. Changing the port You can change the default port by editing the sshd configuration file. sudo nano /etc/ssh/sshd_config Find the line that say #Port. Remove the # symbol and set the port number you prefer. Refer to the image below as reference....

December 27, 2022 · John Pili

Rsync with different SSH port

Some Linux servers were security hardened by changing the default SSH port from port 22 to a different port number. To use rsync with a different SSH port, add ‘ssh -p 12345’ in the rsync parameters. Push rsync -azvP -e 'ssh -p 12345' SOURCE [email protected]:DEST Pull rsync -azvP -e 'ssh -p 12345' [email protected]:SOURCE DEST

December 26, 2022 · John Pili

Setup Static IP Address in Debian Linux

Setting up static IP address in Debian Linux is easy. In this simple guide, I will be configuring the IP address using the old way (ifconfig) and requires that you have system administration rights to do the following steps: Open the network interface file with the following command: sudo vi /etc/network/interfaces Once opened you might see something similar like this Your interface label might be different from the example but in this case we are interested in making interface ens33 to have a static IP....

June 12, 2021 · John Pili
Allow user or group to run sudo on specific applications in Linux

Allow user or group to run sudo on specific applications in Linux

In some situation, we may want to delegate a sudo capability to Linux users or groups without completely giving them full access to the operating system. We can achieve this by using User_Alias inside the /etc/sudoers configuration file. I will share the simple settings that I used in my RHEL server. ## Sudoers allows particular users to run various commands as ## the root user, without needing the root password. ## ## Examples are provided at the bottom of the file for collections ## of related commands, which can then be delegated out to particular ## users or groups....

May 2, 2021 · John Pili

Create a Linux systemd entry for your application

Systemd is a Linux software suite that handles system services (daemon) and timers; it enables you to start, stop and restart your application using systemctl command. It can also start your application during operating systems boot-up sequence. Note that you will need to have root or sudo privileges for this operation. To create a systemd unit file, create a service file inside the directory /etc/systemd/system/. The filename must end with ....

January 4, 2021 · John Pili

Setup static IP address in Red Hat Enterprise Linux 8

Setting up a static IP address in your RHEL or CentOS is simple. Prerequisite This how-to guide requires that you have administrative access to the Linux operating system. Steps Inside the RHEL Operating system, open the terminal and head to /etc/sysconfig/network-scripts. Using ls command, you can see the available network devices in the directory. cd /etc/sysconfig/network-scripts ls Use a text editor to edit the specific network device configuration...

October 20, 2020 · John Pili
How to change MySQL’s root to use mysql_native_password in Ubuntu

How to change MySQL’s root to use mysql_native_password in Ubuntu

In some MySQL installation in Ubuntu. You cannot login as root because it is not configured to use mysql_native_password. In this post, I will teach you how to enable mysql_native_password. Log in to MySQL via terminal with sudo mysql -u root Once inside MySQL, we will need to change the default plugin authentication to mysql_native_password and set a password for root. mysql> ALTER USER [email protected] IDENTIFIED BY 'password'; mysql> exit You can now login in MySQL as root using the password you set....

October 8, 2020 · John Pili

Login as Jenkins in Linux Terminal

You may need to setup an SSH keys or environment variables to your Jenkins installations. One of the easy way to do this is to setup those environment variables inside the jenkins user account. If you installed Jenkins in CentOS or Ubuntu via YUM or APT; These package managers will setup a jenkins user account without login capability and shell. That means you cannot simply SSH to it. Using your other Linux account you can login as jenkins using the command snippet below....

August 14, 2020 · John Pili

Create Android Studio Shortcut on Ubuntu 18.04

You can easily create an Android Studio shortcut by creating an desktop entry using the following the steps below. In this guide, my Android Studio is installed in /opt/android-studio folder. Your folder location may differ. Open terminal and type cd ~/.local/share/applications Create a .desktop file using your favorite text editor nano android-studio.desktop My .desktop file looks like this [Desktop Entry] Version=1.0 Type=Application Name=Android Studio Icon=/opt/android-studio/bin/studio.png Exec="/opt/android-studio/bin/" %f Categories=Development;IDE; Terminal=false StartupWMClass=jetbrains-android-studio As a template for desktop entry you can use this snippet...

April 14, 2020 · John Pili

How to change Full Disk Encryption (LUKS) password on Ubuntu 18.04

Did you enabled the full disk encryption (LUKS) on Ubuntu 18.04? I would like to share how you can change the LUKS password. LUKS stands for Linux Unified Key Setup developed in 2004 by Clemens Fruhwirth. Similarly, Apple’s macOS have FileVault and BitLocker for Microsoft Windows operating system. In the terminal you can check the drives or partition with LUKS by using this command lsblk My result looks like this....

April 12, 2020 · John Pili