how restart SSH server

Anything regarding SSL/SSH and other security questions may go here
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/su ... p?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
mischaq
Versed
Versed
Posts: 279
Joined: Mon Jul 16, 2007 7:37 pm

how restart SSH server

Unread post by mischaq » Thu Apr 03, 2008 8:53 pm

hi modders

how can i restart DS's ssh server without complete reboot of the DS, so that the ssh-server adapts to a changed sshd_config-file?

thanks!
mischaq

Svuppe
Student
Student
Posts: 65
Joined: Tue Jan 16, 2007 11:17 pm

Re: how restart SSH server

Unread post by Svuppe » Thu Apr 03, 2008 9:50 pm

I use these two commands:

killall sshd
/usr/syno/etc.defaults/rc.d/S95sshd.sh start

mischaq
Versed
Versed
Posts: 279
Joined: Mon Jul 16, 2007 7:37 pm

Re: how restart SSH server

Unread post by mischaq » Thu Apr 03, 2008 10:57 pm

is there a difference between them?
which one should i use (i guess i just enter them in a "Diskstation>"-Prompt...also when logged in via ssh?)

..many thanks

Svuppe
Student
Student
Posts: 65
Joined: Tue Jan 16, 2007 11:17 pm

Re: how restart SSH server

Unread post by Svuppe » Fri Apr 04, 2008 7:15 am

Yes, there certainly is a difference. The first one stops the ssh server, and the second starts it again.
And I don't recommend doing it while logged in via ssh. As soon as you type the first command, the ssh server is shut down, and then you are disconnected. Do this using telnet instead.

mischaq
Versed
Versed
Posts: 279
Joined: Mon Jul 16, 2007 7:37 pm

Re: how restart SSH server

Unread post by mischaq » Fri Apr 04, 2008 10:36 am

ok - thanks...sorry for my noobness :D

mischaq
Versed
Versed
Posts: 279
Joined: Mon Jul 16, 2007 7:37 pm

Re: how restart SSH server

Unread post by mischaq » Fri Apr 04, 2008 10:39 am

what about "/etc/init.d/sshd restart"

...found this searching the froum for restart sshd

cheers, mischaq

Svuppe
Student
Student
Posts: 65
Joined: Tue Jan 16, 2007 11:17 pm

Re: how restart SSH server

Unread post by Svuppe » Fri Apr 04, 2008 4:21 pm

The directory "init.d" doesn't even exist, so that won't work at all.
At least I don't have it on my 107+ with the newest firmware.

Ben
I'm New!
I'm New!
Posts: 6
Joined: Fri Jun 13, 2008 6:31 pm

Re: how restart SSH server

Unread post by Ben » Sun Jul 13, 2008 9:56 pm

I use the following:

Code: Select all

cd /usr/syno/etc.defaults/rc.d/
./S95sshd.sh restart &
You will loose your SSH session, but at least with the '&' sign, the script will run in the background and the daemon will restart. Easier than going via a Telnet session, though you could want to have one just in case you messed you sshd config... :-)

h_q
I'm New!
I'm New!
Posts: 2
Joined: Tue Aug 26, 2014 9:20 am

Re: how restart SSH server

Unread post by h_q » Tue Aug 26, 2014 9:23 am

I'm new to Synology, in DSM 5, I do:

Code: Select all

kill -HUP `cat /var/run/sshd.pid`

User avatar
Hathor27
Experienced
Experienced
Posts: 100
Joined: Sat Feb 21, 2009 4:09 pm
Location: Switzerland

Re: how restart SSH server

Unread post by Hathor27 » Thu Apr 07, 2016 10:57 pm

Ben wrote:I use the following:

Code: Select all

cd /usr/syno/etc.defaults/rc.d/
./S95sshd.sh restart &
Is it still the same command to restart sshd within DSM 6.0 ?
Best Regards
Hathor27

Hardware: DS107+/DS207+/DS109+/DS209+/DS409/DS211+/DS213j/DS214play/DS214+/DS215+/DS216play/DS416j/DS716+/DX513
Featured: WebAlizer/VPN/ReverseProxy/MailServer/Drive/DNS/DHCP/CMS/SSL/Subversion

burger.ga
I'm New!
I'm New!
Posts: 3
Joined: Thu Apr 21, 2016 4:08 pm

Re: how restart SSH server

Unread post by burger.ga » Mon Feb 27, 2017 7:36 pm

Since I keep googling this myself and ending up here :P

For DSM 6 use

Code: Select all

sudo synoservicectl --restart sshd

Post Reply

Return to “Security/Secured Mods”