Install and configure SSH Server on CentOS

Thanks to the original poster for this great article, please make sure to visit his article here !


OpenSSH Installations under CentOS Linux

To install the server and client type:

Start the service:

Make sure port 22 is opened:

Firewall Settings

Edit /etc/sysconfig/iptables (IPv4 firewall),

Add the line

If you want to restict access to, edit it as follows:

If your site uses IPv6, and you are editing ip6tables, use the line:

Save and close the file. Restart iptables:

OpenSSH Server Configuration

Edit /etc/ssh/sshd_config, enter:

To disable root logins, edit or add as follows:

Restrict login to user tom and jerry only over ssh:

Change ssh port i.e. run it on a non-standard port like 1235

Save and close the file. Restart sshd:

JohnyLuky has written 54 articles

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">