To secure the server furthermore, you can disable password authentication and configure SSH login using SSH keys. The next time you connect to the server you can use the newly created sudo user. Save the changes and restart the service for the changes to take effect. First, create a new sudo user on your Ubuntu server, and then edit the OpenSSH server configuration file. One of the recommended ways to secure your server when using OpenSSH is to disable the Root login. If you can connect to the server via SSH successfully you can continue with the next step which is securing OpenSSH. Now you can try to connect to your server via SSH using the port number you specified in the OpenSSH server configuration file. Then restart the service for the changes to take effect. Open the file and locate the line that specifies the listening port: Port 22Ĭhange it to something else. The first thing you may want to do is to change the default SSH listening port. You can edit the file by using a text editor of your choice. Make sure you create a backup of the original configuration before making any changes: sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig The main configuration file for the OpenSSH server application is /etc/ssh/sshd_config. To disable the service on system boot you can use: sudo systemctl disable rviceĪfter making any changes in the OpenSSH configuration you need to restart the service for the changes to take effect. To enable the service on system boot you can use: sudo systemctl enable rvice To check the status of the service you can use: sudo systemctl status rvice To restart the service you can use: sudo systemctl restart rvice To stop the service you can use: sudo systemctl stop rvice To start the service you can use the following command: sudo systemctl start rvice Furthermore, you can install the OpenSSH client application using the following command: sudo apt-get install openssh-client Configure OpenSSH on Ubuntu 16.04īefore making any changes in your OpenSSH configuration, it is good to know how to manage the OpenSSH service on your Ubuntu VPS. Please note that the OpenSSH server package could be already installed on your system as part of the initial server installation process. To install the OpenSSH server application as well as the other related packages use the command below: sudo apt-get install openssh-server Update the package index using the following command: sudo apt-get update
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |