[HOW TO] start/stop/status ssh on systemd (fedora desktop 21) systemd

What is systemd? please refer here

I think you can confused. Systemd is a latest manage system of Linux.

In this article, I show you overview how to manage ssh on systemd.

Status:
[root@201407COM0047 itien]# systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled)
   Active: active (running) since Thu 2015-04-09 16:14:27 ICT; 5s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 6893 (sshd)
   CGroup: /system.slice/sshd.service
           └─6893 /usr/sbin/sshd -D

Apr 09 16:14:28 201407COM0047 sshd[6893]: Server listening on 0.0.0.0 port 22.
Apr 09 16:14:28 201407COM0047 sshd[6893]: Server listening on :: port 22.


Start:
[root@201407COM0047 itien]# systemctl start sshd

Stop:
[root@201407COM0047 itien]# systemctl stop sshd

SSH will start on boot
[root@201407COM0047 itien]# systemctl enable sshd
Created symlink from /etc/systemd/system/multi-user.target.wants/sshd.service to /usr/lib/systemd/system/sshd.service.

SSH will not start on boot
[root@201407COM0047 itien]# systemctl disable sshd

Thank you for reading this article, please a comment if you are interested.
Tiến Phan - R0039
Knowledge is Endless
Sharing for Success

0 nhận xét:

Post a Comment