How to configure ssh on CentOs 7

the following below show how to configure SSH on CentOs 7

Begin to configure SSH on CentOs 7

Configure SSH Server to login to a server from remote computer
OpenSSH is already installed by default even if you installed CentOS with [Minimal Install], so it’s not necessarry to install new packages. You can login with Password Authentication by default, but change some settings for security like below :

Login via your account and type : 

# vi /etc/ssh/sshd_config 
and then change follow:

#Line 17: Uncomment and change the default port if you want
port 22 (default port) or port 3322 if you want

Restart service after change configure
# systemctl restart  sshd

Stop and disable firewall ( not recommended  because i have another firewall)
# systemctl stop firewalld
# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Finally, disable Selinux 
# vi  /etc/selinux/config

# line 7: Change enforcing -> disabled
Reboot CentOs 7 to apply the settings
# Reboot

Test SSH from MacOs

# ssh -p 3322 [email protected] 

Note: If who have any question or problem about How to install SSH on CentOs 7, please comment or contact me. Don’t forget to follow and join my channel to view more Everything about CentOs 7

One Reply to “How to configure ssh on CentOs 7”

Leave a Reply

Your email address will not be published. Required fields are marked *