불필요한 서비스 정리
# SysV 서비스
$ /sbin/chkconfig --list
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.
hostagent_kr 0:off 1:off 2:on 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
noms_nsight 0:off 1:off 2:on 3:on 4:on 5:on 6:off
xe-linux-distribution 0:off 1:off 2:on 3:on 4:on 5:on 6:off
xinetd based services:
eklogin: on
eklogin.nhn: on
klogin: on
klogin.nhn: on
kshell: on
kshell.nhn: on
# systemd 서비스
$ systemctl list-unit-files --type=service
UNIT FILE STATE
abrt-ccpp.service masked
abrt-oops.service masked
abrt-pstoreoops.service disabled
abrt-vmcore.service masked
abrt-xorg.service masked
abrtd.service masked
arp-ethers.service disabled
atd.service enabled
auditd.service masked
[email protected] enabled
blk-availability.service disabled
...
$ ls /etc/systemd/system/*.wants/
/etc/systemd/system/basic.target.wants/:
total 0
lrwxrwxrwx. 1 root root 41 Aug 12 2015 microcode.service -> /usr/lib/systemd/system/microcode.service
/etc/systemd/system/default.target.wants/:
total 0
lrwxrwxrwx. 1 root root 57 Aug 12 2015 systemd-readahead-collect.service -> /usr/lib/systemd/system/systemd-readahead-collect.service
lrwxrwxrwx. 1 root root 56 Aug 12 2015 systemd-readahead-replay.service -> /usr/lib/systemd/system/systemd-readahead-replay.service
/etc/systemd/system/getty.target.wants/:
total 0
lrwxrwxrwx. 1 root root 38 Aug 12 2015 [email protected] -> /usr/lib/systemd/system/[email protected]
...
root 로그인 터미널 (/etc/securetty)
$ tty
/dev/pts/0
SSH 루트 계정 로그인 (/etc/ssh/sshd_config)
/etc/ssh/sshd_config
PermitRootLogin no 로 하면 SSH를 통한 루트 로그인 거부
- 그 후 sshd 서비스 재시작