SSH server, access on remote server via SSH. CentOS 7 Tutorials

preview_player
Показать описание
Welcome back to CentOS tutorials.

Today I'll show you how to configure SSH daemon on a server and how to access to the remote server via SSH.

CentOS 7 even in minimal installation, has preinstalled SSH daemon and gives the possibility to access on a server.

If in the system you do not have nano or vim editor, you can install them by next commands:
yum install nano
or
yum install vim

First of all, we will check main configuration file. We will use nano(vim) for that purposes. Open up file /etc/ssh/ssh_config.
To make the server more secure we will deny direct access to a server using root login, by changing option "PermitRootLogin : NO".
Also, we directly set ssh port to 22, also by changing the port number from default you are making your server even more secure.
And force our daemon to use v2 version of SSH protocol.
After saving file, do not forget to restart SSH daemon in order to apply the configuration.

Now our server is a little bit secure and ready to accept remote connections to him.

After entering correct password you will get access to a remote server from you local PC.

However using password little bit boring if you have a lot of servers with different users and password. So we will use keys to access to a server.

To do this we need to generate a key on our server using next command:
ssh-keygen -t rsa

By entering some passphrase you making you key even more secure.

When our key is ready, we will copy it to a remote server.

Now you are able to connect to the remote server without a password, all that you need to know a username and IP address of the server.

Enjoy using ssh on IT channel.
Bye bye.

Рекомендации по теме