The post How To Change Your SSH Port Number? appeared first on Free Web Hosting, Free Hosting, Free Trial Hosting With cPanel.
]]>This article requires editing of the key SSH file configurations. You can use any text editor you like, but. In this case we’ll use nano, the Linux Nano text editor.
Step 1: Change your directory to /etc/ssh/ via the below command
cd /etc/ssh/
Step 2: Here, you need to make a backup of your current sshd_config for security side. To do this, run the below command
cp sshd_config sshd_config.bak
Step 3: You’ll now need to edit the sshd_config file using the below command
nano sshd_config
Step 4: In nano, search for the word “port” by using ctrl+w
Step 5: Once you able to locate the port setting, you can delete the # symbol to uncomment the line
Step 6: Change the port number, which should be 22, to any port you wish under eg 1981
Step 7: It is advised not to use the below ports as they are generally in use for the different services
25
53
110
443
495
21
80
2083
2082
2086
2087
2096
9876
You can always use command cat /etc/services to find which port numbers are configured on your server
Step 8: Finally restart the SSH service with the following command and changes will get applied.
service sshd restart
Thank you.
The post How To Change Your SSH Port Number? appeared first on Free Web Hosting, Free Hosting, Free Trial Hosting With cPanel.
]]>The post The rsync command and its usage appeared first on Free Web Hosting, Free Hosting, Free Trial Hosting With cPanel.
]]>It is a great tool/command for synchronizing files and directories. (Remote Sync) is an extremely versatile tool that can be used to copy and synchronize directories and files in remote or local environments. Learning this command will assist you to efficiently transfer information across multiple servers, or create backups to restore. The reason it is so effective is the variety of options that allow control over the behavior of the command, which allows you to adjust to your specific requirements.
It also employs an algorithm known as the “delta-transfer algorithm” that reduces the amount of bandwidth that is transferred through the network by passing the difference between source and destination files. We will cover only a handful of instances in this post, which will hopefully help you understand the basics of this command-line software and help you achieve your objectives.
rsync <option> <source> <destination>
With rsync, you are able to quickly make backups of your website by copying the website’s files from its root directory into a folder specifically designated to store backups. If you are using a cPanel-based server, the domain name’s primary files are stored in the “public_html” directory inside the home directory for the individual user. Backups are saved within the “/backup” global directory.
rsync -aHvz /home/username/public_html/ /backup/website-backup
Let’s try the previous example However, let’s make use of an external server we can transfer the backup
rsync -aHvz /home/username/public_html/ [email protected]:/backups/website-backup
In default rsync will make use of the OpenSSH process to share files since it’s the most secure method. There are occasions when service providers modify their SSH ports due to security concerns. If this happens, rsync provides an option to determine that port as the one to be changed.
rsync -e "ssh -p " -aHvz /home/username/public_html/ [email protected]:/backup/website-backup
The “-e” flag allows you to set the SSH service’s customized port. This command is able to work in the reverse direction, permitting you to transfer documents from the server and transfer them to locally hosted servers. It is possible to pull files from the remote server “pull” process is also often referred to as an “reverse rsync”, and it is a way to restore an earlier version of your site. This is what it looks like:
rsync -aHvz [email protected]:/backup/website-backup/ /home/username/public_html/
Do you realize that rsync can be used to erase files, too? It’s one of the fastest, if not the most efficient methods to accomplish this, particularly when you have lots of files that require an enormous amount storage space on your disk. In order to use this method it is necessary to create a blank directory. It doesn’t matter what the name is in this scenario. The crucial thing is that it remains empty. Finally, you need to use the following command:
rsync -a --delete name-of-empty-folder/ name-of-folder-you-want-to-delete/
What rsync will be doing is creating a synchronization between the empty directory and the complete one, basically not syncing anything with anything that will remove all files in the directory that are populated. Be very careful while doing this, because the process is irreversible and absent a backup, you’re unlikely to retrieve your information.
The post The rsync command and its usage appeared first on Free Web Hosting, Free Hosting, Free Trial Hosting With cPanel.
]]>