Install and configure SSH on Centos 6.4 6.3 5.9 Redhat RHEL Fedora

Install and configure SSH on Centos 6.4 6.3 5.9 Redhat RHEL Fedora




Step 1: Install Open SSH Server and SSH client on Centos / Redhat RHEL / Fedora

[root@localhost Desktop]# yum -y install openssh-server openssh-clients
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base:
* epel:
* extras:
* rpmforge:
* updates:
Setting up Install Process
Package openssh-clients-5.3p1-84.1.el6.x86_64 already installed and latest version
Resolving Dependencies
–> Running transaction check
—> Package openssh-server.x86_64 0:5.3p1-84.1.el6 will be installed
–> Finished Dependency ResolutionDependencies Resolved================================================================================
Package Arch Version Repository Size
openssh-server x86_64 5.3p1-84.1.el6 base 299 kTransaction Summary
Install 1 Package(s)Total download size: 299 k
Installed size: 652 k
Downloading Packages:
openssh-server-5.3p1-84.1.el6.x86_64.rpm | 299 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : openssh-server-5.3p1-84.1.el6.x86_64 1/1
Verifying : openssh-server-5.3p1-84.1.el6.x86_64 1/1Installed:
openssh-server.x86_64 0:5.3p1-84.1.el6

[root@localhost Desktop]#

Step 2: Start OpenSSH Service and add to boot list

[root@localhost Desktop]# chkconfig sshd on
[root@localhost Desktop]# /etc/init.d/sshd start
Starting sshd: [ OK ]
[root@localhost Desktop]#

Step 3: OpenSSH Server configuration (Optional)

[root@localhost Desktop]# vi /etc/ssh/sshd_config

To disable root logins, edit or add as follows:

PermitRootLogin no

Restrict login to user tom and jerry only over ssh:

AllowUsers kevin

Change ssh port (default 22)

Port 222

Restart service after changing SSH configuration

[root@localhost ~]# /etc/init.d/sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
[root@localhost ~]#

That’s all. Thanks for using

Leave a reply

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