Home

리눅스 rsyslog를 활용하여 message 로그 수집 / Linux rsyslog collect log

1. 로그를 수집하는 서버 로그서버 한개를 대표로 놓고 다른서버의 로그를 수집하는 설정방법 입니다. Amazon linux 2 기준으로 작성되었습니다. 원격지 서버의 message log를 수집하는 설정입니다. [root@ip-10-10-20-1 log]# cat /etc/rsyslog.conf | grep -Ev "^$|#" $ModLoad imudp # 주석제거 $UDPServerRun 514 #주석제거 $WorkDirectory /var/lib/rsyslog $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat $IncludeConfig /et...

Read more

리눅스 jar 파일 시스템에 등록하기 / Linux jar file systemctl register

1. Vi 에디터를 사용하여 어플리케이션 등록파일 생성 하기 myapp 은 예시 입니다. 상황에 맞게 이름을 변경하여 등록합니다. 파일 생성시 jar파일의 경로와 파일명을 확인합니다. StandardOutput=null 옵션을 주지 않을 경우 시스템에 등록된 프로세스의 log가 /var/log/messsage 에 기록됩니다. 프로세스의 경우 별도의 log를 설정하는 경우가 많으니 필요하지 않다면 해당 옵션을 주어 불필요한 log를 남기지 않도록 합니다. vi /etc/systemd/system/myapp.service [Unit] Description=Kisa scheduler Service After...

Read more

리눅스 보안 배너 경고문구 (banner) / Linux banner

1. 배너문구 설정하기 리눅스 보안 사항 중 경고(warning)메세지를 설정해야 하는 사항이 있습니다. 아래 문구를 /etc/motd, /etc/issue, /etc/issue.net 에 등록하여 사용하시면 됩니다. 문구를 알맞게 수정하여 사용하셔도 됩니다. vi /etc/motd =============================================================================== 본시스템은 허가된 사용자만 이용하실수 있습니다. 부당한 방법 또는 무단으로 전산망에 접속하거나 정보를 삭제,변경,유출하는 사용자는 관련법령에 따라 처벌 받게 됩니다 This is ...

Read more

리눅스 계정 보안(패스워드 복잡성 설정하기) / Linux password complexity

CentOS 6 이상 버전에서는 system-auth 설정을 통해 복잡성 설정이 가능합니다. 하기 내용을 참고하셔서 각 파일의 설정으로 계정을 보호하시기 바랍니다. In CentOS 6 and higher, complexity can be set via the system-auth setting. Please refer to the following to protect your account with the settings of each file. system-auth deny=5 unlock_time=300 : 계정로그인시 5회 실패할 경우 300초에 lock 타임 발생 type=minl...

Read more

리눅스 잠긴 계정 해제 / unlock linux locked account

리눅스 서버운영시 사용자의 계정이 비밀번호 입력 초과 또는 오랫동안 미사용으로 인해 잠겨있는 상태를 해제하는 명령어 입니다. This command unlocks the locked state of a user’s account due to excessive password entry or long-term inactivity when operating a Linux server. 1. 계정상태 확인(Check account status) pam_tally2 -u account_id 2. 계정 잠금 해제(unlock account) pam_tally2 -u account_id --reset ...

Read more

select 문을 활용한 ssh 접속 script / ssh connection script using select

select 문을 활용하면 자주 접속하는 서버의 IP리스트를 만들어 선택하여 접속하는 방법입니다. 기본 22 port를 사용하지 않을 경우에는 port 변수를 만들어 사용하시면 됩니다. Using the select statement, you can create a list of frequently accessed server IPs and select and access them. If you do not use the default 22 port, you can create and use a port variable. #!/bin/bash # 서버리스트(Server List) SERVER_LIS...

Read more