# /etc/init.d/apache2 restart OR # apache2ctl restart. See how to restart Apache Web Server on Ubuntu Linux for more information. Restart Nginx for php service. If you are using Nginx web-server type the following command to restart nginx: # /etc/init.d/nginx restart OR # service nginx restart OR # nginx -s reload. Restart Lighttpd for php service. OpenSSH for OpenBSD. Since OpenSSH is developed by the OpenBSD group, OpenSSH is included in the base operating system, starting at OpenBSD release 2.6.
Once you are done save the file and restart the SSH service. On Ubuntu or Debian servers, run the following command: sudo systemctl restart ssh. On CentOS or Fedora servers, run the following command: sudo systemctl restart sshd; Conclusion #. For some reason sshdgenkeys.service was already started before I tried to start sshd.service, this makes sshd.service fail and no keys are generated, so the solution is to make sure sshdgenkeys.service is stopped before trying to start sshd.service. Marking this as SOLVED now. How do I restart sshd on my Unix system After you have changed your configuration on your remote Unix/linux server you must restart your ssh service. The easiest way to do this is to simply restart your Unix machine. This is not always possible however.
Managing services is a key responsibility for sysadmins. There is no doubt that the transition between the older SysV method (using the service
and chkconfig
commands) and the newer systemd
-based commands (such as systemctl
) was controversial. In fact, many sysadmins still have very strong feelings one way or the other.
The reality is that many distributions, Red Hat Enterprise Linux (RHEL) included, have begun managing services with systemd
. Hence, you and I need to know how to work with the systemctl
management command.
More Linux resources
I'm not the kind of author/trainer/admin that assumes everyone is advanced. With that in mind, I'm going to aim this article at the folks who need a fundamental and straightforward explanation of how and when to use the more common systemctl
subcommands. At the end, I also provide a great trick for quickly displaying all the systemctl
subcommands.
Note: The systemctl man page refers to the second word in the string as a 'command,' which seems somewhat confusing. I will refer to systemctl
itself as a command, then the string following it as a subcommand. The argument is the name of the service and occupies the third position in the syntax.
Here is a syntax example:
I'll demonstrate how and when to use systemctl
. Most of my examples use the common sshd
service.
[ Readers also enjoyed: How I learned to stop worrying and love systemd ]
Service status
The best place to start is to understand the current functionality of the service. I'll begin with the most simple approach, the use of the status
subcommand:
How to restart the SSHD service on Windows.
Requirements user or command shell need elevated privileges
Note: Any users connected to the SSH server will be disconnected when the SSH is restarted.
The GSW SSH Server reads configuration values each time the GSW_SSHD service is started. It is the mechanism to read the configuration registry keys into the SSH Server and apply those values.
Two options for re-starting the GSW SSH Service are:
Option 1: In the Windows Start, Search or Run command enter services.msc and press enter
Restart Sshd Daemon
- Select the Extended tab at the bottom
- Select Georgia Softworks GSW_SSHD service
Click Restart the service.
Figure 1: Restart SSHD Services for Windows
Restart Sshd Aix
The Georgia SoftWorks GSW_SSHD service and the Georgia SoftWorks Universal Terminal Server should both have a status of Started and a Startup Type of Automatic. Using the Windows Services utility is the recommended method to start and stop the GSW services when required.
Option 2: | You may use a batch program or windows command shell to restart SSH service. In the Windows Start Menu, search box type in cmd.exe and in the results right click cmd.exe and select Run as administrator. |
Ssh Service Restart
In the command shell enter the following.
net stop gsw_sshd && net start gsw_sshd
Figure 2: Command shell to restart the GSW SSHD Service
Confirm that the GSW SSH Service is running.
Using the Installation Status Program Item within Georgia SoftWorks UTS program group, you can view the Installation Status of the GSW UTS and SSH Server.
Figure 3: SSH Service Installation Status
View the row “Georgia SoftWorks SSH Shield”. The far right column “running” should have a ✔ check in the check box as shown above.
Watch How to restart SSH service on Windows
Back to SSH Server FAQ
Document Number: FAQ-SSH-EX030001081519