Change Host Name of Linux Red Hat or CentOS Permanently
Here is the short commands to change the host name of your linux Red Hat or CentOS 5 & 6 operating system, Follow the below steps:
How do i access my server
In this post i will describe you to how you can access your new server from SSH, the tutorial i am writing is best source for the beginners who really do not know how they can access their linux server from the windows desktop. You would need a software named putty it enables you to access your linux based server from the windows.
What is Putty?
Putty is most powerful and reliable windows client used to manage/access linux based web server from the windows desktop. It is very light client application and gives the command line interface to manage the server. You must know some basic linux commands in order to manage your server, i will post some basic commands list in next few days.
Download putty from this link:
Now run putty by clicking on its icon that you downloaded recently.
Program will run and you will see basic window of putty containing some basic input boxes and buttons.
- Write your server’s ip address that is provided with your server by your service provider in the input box below the “Host Name (or ip address)“.
- The default port is 22 leave it as it is.
- Select SSH from the below list (Radio button), by default it is already selected.
- You can save your details for later use either, just put any name in the input box where it is asking for Saved Session.
- Now click on Open button located in the bottom.
- A new command window will appear asking for root username, write the root username and press [Enter] key.
- Then you will be asked to provide root password, write the password that is provided by your provider.
- Do not worry if the password you are entering is not showing, it does not show for security purpose, just enter your password and press [Enter] key.
- You will be logged in to the server and a successful logged on message will be appeared with last login details.
- Thats all, now you can execute any linux shell command from here.
This is the basic tutorial written for beginners and learners, i will describe some useful commands within next few days, keep visiting till that.
Your queries are always welcome here.
Harden SSH Access (Change Port)
In this post/article i will describe how to increase your security to prevent hacking attacks from the SSH server. You should apply some configurations and tweaks on the SSH server to ensure the maximum security of your server.
Follow the below instructions:
- Login to your server through SSH with root access.
Change SSH Port:
The first step of this tutorial is to change the default port of the SSH server. This is most usable way to protect your server from SSH attacks.
# nano /etc/ssh/sshd_config
- Find the line in that page:
What ports, IP and Protocols we listen for
- Change the Port 22 to any integer you like e.g:
- and save the configurations. Restart the SSH server:
# service sshd restart
Note: You should not use the port number that is already being used by another services