Monday, June 29, 2015

Restart ssh service in linux

[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>ssh ats-earms-lnx
ssh: connect to host ats-earms-lnx port 22: Connection refused
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>ping ats-earms-lnx
PING ats-earms-lnx.cisco.com (10.105.33.158) 56(84) bytes of data.
64 bytes from ats-earms-lnx.cisco.com (10.105.33.158): icmp_seq=1 ttl=59 time=0.399 ms
64 bytes from ats-earms-lnx.cisco.com (10.105.33.158): icmp_seq=2 ttl=59 time=0.411 ms
64 bytes from ats-earms-lnx.cisco.com (10.105.33.158): icmp_seq=3 ttl=59 time=0.401 ms
64 bytes from ats-earms-lnx.cisco.com (10.105.33.158): icmp_seq=4 ttl=59 time=0.389 ms

--- ats-earms-lnx.cisco.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.389/0.400/0.411/0.007 ms
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>rsh ats-earms-lnx
Last login: Wed Jun 10 20:08:57 from bgl-ads-843.cisco.com
Cisco Linux 5.03-4 Kickstarted on: Mon Dec 19 08:30:34 IST 2011.
Terminal is set to: vt100
Display is set to: bgl-ads-843:1
ats-earms-lnx>
ats-earms-lnx>

Login as root user

Execute "/etc/init.d/sshd restart"

Logout and try to ssh again .. it should work ..

ats-earms-lnx>
srikragh logged out at Tue Jun 30 10:27:53 IST 2015.
rlogin: connection closed.
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>
[bgl-ads-843:/auto/tftp-eARMS3-blr/dhcp]>ssh ats-earms-lnx
Last login: Tue Jun 30 10:27:43 2015 from ats-earms-lnx
Cisco Linux 5.03-4 Kickstarted on: Mon Dec 19 08:30:34 IST 2011.
Terminal is set to: vt100
Display is set to: bgl-ads-843:1
ats-earms-lnx>
ats-earms-lnx>

Source: http://www.cyberciti.biz/faq/howto-restart-ssh/

No comments:

Post a Comment