Unix/Linux/MacOS
원격 rsyslogd 설정
■ rsyslogd Server 측 설정 # vi /etc/rsyslog.conf $ModLoad imudp $UDPServerRun 514 $template FILENAME,”/var/log/%HOSTNAME%/%$YEAR%_%$MONTH%_%$DAY%.log” *.* ?FILENAME ■ rsyslogd Client 측 설정 # vi /etc/rsyslog.conf *. * @192.168.10.35:514 또는 mail.* @192.168.10.35:514 ■ 작동 확인 systemctl status rsyslog.service rsyslogd -v
[VMware] CentOS 6 VM 이미지 복사 후 eth0 안잡힐때
vi /etc/udev/rules.d/70-persistent-net.rules or rm -f /etc/udev/rules.d/70-persistent-net.rules 내용을 다 삭제 후 다시 부팅.
[VMware] CentOS 6 VM 이미지 복사 후 eth0 안잡힐때 더 읽기"
SELINUX 작동여부 판단
sestatus SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: disabled Policy version: 24 Policy from config file:
리눅스 캐쉬 비우기 (메모리 확보)
# 플러싱 하기 (반드시 먼저 실행할 것!!) sync # pagecache 비우기 sysctl -w vm.drop_caches=1 # dentries, inodes 비우기 sysctl -w vm.drop_caches=2 # pagecache, dentries, inodes 모두 비우기 sysctl -w vm.drop_caches=3 # pagecache, dentries, inodes 캐쉬 시작 sync echo 0 > cat /proc/sys/vm/drop_caches # crontab -e (매시간 마다 실행) 0 * * * * /usr/bin/sync &&
sshd에 banner 넣기
1. /etc/banner 편집 WARNING: Unauthorized access to this system is forbidden and will be prosecuted by law. By accessing this system, you agree that your actions may be monitored if unauthorized usage is suspected. 2. vi /etc/ssh/sshd_config Banner /etc/banner 구문 추가 3. sshd 재시작
postfix 기본 설정
$ vi /etc/postfix/main.cf 후 아래 항목들을 수정 후 추가한다. myhostname = smtp.example.com inet_interfaces = all mynetworks_style = subnet mynetworks = 10.10.10.0/24, 127.0.0.0/8 # service postfix restart or # systemctl restart postfix
docker 기본 명령어
※ container는 VM 프로세스 개념, image는 docker image file 개념.■docker 이미지 다운로드 docker pull <이미지:버전> docker pull <이미지:latest> ex) docker pull aikidosecurity/local-scanner ex) docker image pull debian:bookworm ex) docker pull ubuntu:latest■docker 컨테이너 생성 docker create <이미지>■docker 실행 docker start my_container docker start container1 container2 container3 docker start -a my_container -a: 컨테이너를 시작함과 동시에 표준 출력(stdout)
ps 명령어 사용법
■ BSD Style 옵션 a : BSD Style 옵션을 사용하겠음. x : BSD Style (모든 프로세스) j : BSD job cotrol format f : 쓰레드를 트리형태로 출력 ■ 일반 옵션 -a : 최근에 많이 실행된 제어 터미널을 가진 프로세스의 정보를 출력 -e : 모든 프로세스 (=-A) -f : Full-format -H : 쓰레드를 트리형태로
crontab
■ crontab 옵션 crontab -e : 편집 crontab -l : 목록 보기 crontab -j : 삭제 ■ 기본 포맷 * * * * * 분(0-59) 시간(0-23) 일(1-31) 월(1-12)
nc(netcat) 명령어 사용법
출처: http://htst.tistory.com/61 넷캣(Netcat)은 TCP나 UDP 프로토콜을 사용하는 네트워크 연결에서 데이터를 읽고 쓰는 간단한 유틸리티 프로그램이다. 일반적으로는 UNIX의 cat과 비슷한 사용법을 가지고 있지만 cat이 파일에 쓰거나 읽듯이 nc는 network connection에 읽거나 쓴다. 이것은 스크립트와 병용하여 network에 대한 debugging, testing tool로써 매우 편리하지만 반면 해킹에도 이용범위가 넓다. Netcat(이하 nc로 표기)은 Network connection 에서 raw-data read, write를 할수 있는
CentOS7에 aoache-tomcat 8 버전 설치
1. /opt에 apache-tomcat 압축 해제 및 사용자 추가 cd /opt tar xvzf ~/apache-tomcat-8.5.32.tar.gz ln -s apache-tomcat-8.5.32 tomcat useradd -d /opt/tomcat -c "Apache-Tomcat" -s /bin/false tomcat chown -R tomcat:tomcat /opt/tomcat /opt/apache-tomcat-8.5.32 2. systemd 설정파일 작성 vi /etc/systemd/system/tomcat.service # Systemd unit file for tomcat [Unit] Description=Apache Tomcat Web Application Container After=syslog.target network.target [Service] Type=forking Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
CentOS7에 aoache-tomcat 8 버전 설치 더 읽기"
[Ubuntu] 인터페이스명 변경하기
# dmesg | grep eth [ 1.733275] e1000 0000:02:01.0 eth0: (PCI:66MHz:32-bit) 00:0c:29:2d:67:1a [ 1.733307] e1000 0000:02:01.0 eth0: Intel(R) PRO/1000 Network Connection [ 2.153651] e1000 0000:02:06.0 eth1: (PCI:66MHz:32-bit) 00:0c:29:2d:67:24 [ 2.153926] e1000 0000:02:06.0 eth1: Intel(R) PRO/1000 Network Connection [ 2.156536] e1000 0000:02:06.0 ens38: renamed from eth1 [ 2.159660] e1000 0000:02:01.0
리눅스 서버의 TCP 네트워크 성능을 결정짓는 커널 파라미터 이야기
출처 : http://meetup.toast.com/posts/53 목차 들어가기 전에 준비 TCP 대역폭(bandwidth) 관련 파라미터3.1 BDP3.2 TCP window scaling3.3 TCP socket buffer size3.4 congestion window size 네트워크 capacity 관련 파라미터4.1 maximum file count4.2 backlogs4.3 port range TIME_WAIT socket5.1 TIME_WAIT 상태의 소켓이 무엇일까요?5.2 TIME_WAIT socket buckets5.3 TIME_WAIT socket reuse (TW_REUSE)5.4 TCP timestamp5.5 TIME_WAIT socket recycling (TW_RECYCLE)5.6 Socket linger option 결론 맺으며
리눅스 서버의 TCP 네트워크 성능을 결정짓는 커널 파라미터 이야기 더 읽기"
ip command (CentOS 7) 사용 방법
1. 인터페이스 상태 확인ip addr showip route showip link show 2. IP주소 및 디폴트 게이트웨이 추가ip addr add 10.10.10.35/24 dev ens33ip route add default via 10.10.10.254 # vi /etc/resolv.confnameserver 8.8.8.8 3. Network 재시작systemctl restart networkingsystemctl restart network.service 4. 인터페이스 up/downip link set ens33 upip link set ens33 down 5. Static Route 추가/삭제ip route add 10.10.20.0/24
ip command (CentOS 7) 사용 방법 더 읽기"
rsync service
■ rsync 서버 설정 1. /etc/xinetd.d/rsync service rsync{ disable = no socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = –daemon log_on_failure += USERID} 2. /etc/rsyncd.conf [10.10.10.100_hyper-v]path=/sdc1comment = Public Folderexclude = lost+found/
CentOS 7 GNOME 라이선스 메세지 처리
CentOS 7 에서 부팅 시 아래와 같은 GNOME 라이선스 동의요구 메세지가 나오면서 진행이 되지 않을때 처리하는 방법. =============================================================================== Initial setup of CentOS Linux 7 (Core) 1) [!] License information 2) [ ] User creation (License not accepted) (No user will
CentOS 7 GNOME 라이선스 메세지 처리 더 읽기"
CentOS7 호스트네임(hostname) 변경하기
1. 호스트명 변경 hostnamectl set-hostname <호스트명> 2. 호스트명 확인 hostnamectl status 3. /etc/hosts 파일에 호스트명 추가
CentOS7 호스트네임(hostname) 변경하기 더 읽기"
Armbian WIFI 셋팅
출처 : https://forum.armbian.com/topic/1237-opi-one-wireless-success/ There seems to be a lot of confusion and missing information on how to access the dirt cheap OPI ONE wirelessly and the steps necessary to successfully use cheap Realtek USB dongles ( 8188cus, 8188eu ) with Armbian_5.10. This is a short summary of the needed materials and steps to turn your OPI ONE into
bonding (CentOS 7)
■ bonding 모듈 로드 modprobe –first-time bonding ■ /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 NAME=bond0 TYPE=Bond BONDING_MASTER=yes BONDING_OPTS=”mode=active-backup primary=eno1 miimon=100 updelay=0 downdelay=0″ IPADDR=10.10.10.106 PREFIX=24 GATEWAY=10.10.10.254 DNS1=8.8.8.8 DNS2=8.8.4.4 ■ /etc/sysconfig/network-scripts/ifcfg-eno1 NAME=bond-slave-eno1 DEVICE=eno1 TYPE=Ethernet BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes ■ /etc/sysconfig/network-scripts/ifcfg-eno2 NAME=bond-slave-eno2 DEVICE=eno2 TYPE=Ethernet BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes ■ 적용 systemctl restart network ■ bonding 상태 체크 cat /proc/net/bonding/bond0
