How to enable SSH access to CentOS 6


Article ID: 178578


Updated On:


Mobility Suite




How to enable SSH

(Part of a series on Symantec Mobility: Suite)

1.   To install SSH, as root enter:
sudo yum –y install openssh-server openssh-clients

2.   Set the service to start with the machine:
chkconfig sshd on

3.   Start the service:
service sshd start

4.   Make sure port 22 is opened:
netstattulpn | grep :22

5.   If port 22 is not open, edit /etc/sysconfig/iptables, as before:
vi /etc/sysconfig/iptables

6.   Add the line:
-A -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

7.   Save and close the file. Restart iptables:
sudo service iptables restart

8.   Reboot the system by typing:
sudo reboot

Tip: Quick guide to vi:
à Insert
Esc key
à End insert mode and returns to command mode which allows the below two commands:
à Colon followed by q! quits without making any changes.
à Colon followed by wq writes and quits, saving changes.