티스토리 뷰
Ubuntu 20.x 이후 버전에는 rc-local 서비스가 비활성화 되어 있다.
1. /etc/rc.local 파일 생성
[localhost$ ] sudo nano /etc/rc.local
#!/bin/bash
iptables -A OUTPUT -p tcp --tcp-flags RST RST -j DROP
# 실행할 명령어
exit 0
[localhost$] sudo chmod +x /etc/rc.local
2. /lib/systemd/system/rc-local.service 파일 수정
[localhost$ ] sudo nano /lib/systemd/system/rc-local.service
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
# 하단 내용 추가
[Install]
WantedBy=multi-user.target
3. 서비스 등록
[localhost$ ] sudo systemctl daemon-reload
[localhost$ ] sudo systemctl enable rc-local.service
[localhost$ ] sudo systemctl start rc-local.service
'Study > System' 카테고리의 다른 글
[ELK Stack] Elastic, Kibana 설치 (0) | 2023.09.11 |
---|---|
wget으로 ftp 사용하기 (0) | 2023.06.30 |
[Linux] bash history에 Timestamp 남기기 (0) | 2023.01.28 |
[centos7] python 설치 (0) | 2023.01.26 |
Windows 10 cmd 창 안 열릴 때 (0) | 2022.05.27 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- bash modification
- NX ASLR
- text2pcap
- metasploitable3
- cisco ssh
- tshark
- recovery file on linux
- ssl decrypt
- bash parameter
- dvwa_command
- docker_dvwa
- excel_aton
- dvwa_bruteforce
- docker
- megacli
- pcapng
- ${1##*.}
- editcap
- mergecap
- capinfos
- webhack
- filesystem check
- 윈도우 패스워드 복구
- tcpdstat
- 도커
- MySQL csv
- oracle 11gr2
- history timestamp
- dvwa
- 리눅스 버전
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함