리눅스 각 기본계정별 설명입니다.
·
IT기술 관련/리눅스
출처:http://mrain7.egloos.com/2725507 root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin = 로컬 프린트 서버 sync:x:5:0:sync:/sbin:/bin/sync = 원격지 서버 동기화 shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown = soft 시스템 종료 halt:x:7:0:halt:/sbin:/sbin/halt = 강제시스템 종료 mail:x:8:12:mail:/v..
/bin/false, /sbin/nologin 의 차이점
·
IT기술 관련/리눅스
출처: http://faq.hostway.co.kr/?mid=Linux_ETC&page=2&document_srl=1624 /bin/false, /sbin/nologin 의 차이점 /etc/passwd 사용자계정 부분에 /bin/false, /bin/nologin 등으로 설정할 경우가 있는데 그 차이점입니다. /bin/false allows a login, but no shell, no ssh tunnels and no home directory. -> 시스템의 로그인은 불가능, FTP 서버 프로그램같은 프로그램도 불가능하다. 쉘이나 ssh과 같은 터널링(원격접속) 그리고 홈디렉토리를 사용할 수 없다. /sbin/nologin disallows logins completely and returns a p..
[Linux] 리눅스 열린 포트 및 프로세스 확인
·
IT기술 관련/리눅스
출처: http://www.binarytides.com/linux-netstat-command-examples/ netstat -nlpt 1. List out all connections The first and most simple command is to list out all the current connections. Simply run the netstat command with the a option.$ netstat -a Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 enlightened:domain *:* LISTEN tcp 0..
[리눅스] nmap 명령어 사용 예제
·
IT기술 관련/리눅스
출처: http://sisiblog.tistory.com/21 https://nmap.org/book/man.html http://www.cyberciti.biz/networking/nmap-command-examples-tutorials/ 리눅스 nmap 명령어 사용 예제 nmap은 network mapper의 줄임말로 네트워크 탐색과 보안감사를 하는 오픈소스 툴입니다. 이 툴은 거대한 네트워크를 반복적으로 스캔할 수 있도록 디자인 되었지만 단일 호스트에서도 잘 작동합니다. nmap은 네트워크상의 어떤 호스트가 작동중인지, 그 호스트가 어떤 서비스를 하는지, 운영체제가 무엇인지, 어떤 패킷필터나 방화벽을 쓰는지 등을 알아내기 위해 raw ip 패킷을 사용합니다. 이는 보통 보안감사용으로 쓰이지만 네트워..
[리눅스] terminfo 사용하기
·
IT기술 관련/리눅스
출처: http://timedigit.blogspot.kr/2013/10/so-i-tried-this-simple-program-to-test.html http://stackoverflow.com/questions/21477407/llvm-3-5-fails-to-link 1.에러 -> term.h 못찾겠다(fatal error: term.h: No such file or directory) 해결책 sudo apt-get install libncurses5-dev libncursesw5-dev 로 설치 2. root@ubuntu:/home/c# gcc -o badterm badterm.c /tmp/ccolx2wA.o: In function `main': badterm.c:(.text+0x20): undef..
[Linux] 리눅스 규범 모드 vs 비규범 모드
·
IT기술 관련/리눅스
참고: http://database.sarang.net/study/glibc/12.htm http://www.gnu.org/software/libc/manual/html_node/Canonical-or-Not.html 규범모드 canonical mode 또는 표준 모드 standard mode 라고 부르며, 규범 모드에서는 모든 입력이 줄 단위로 처리된다. 한줄이 완성되기 전까지는(즉, 일반적으로 Enter키를 누를 때까지) 터미널 인터페이스가 모든 키눌림을 관리 이 모드의 반대가 비규범 모드이다. In canonical input processing mode, terminal input is processed in lines terminated by newline ('\n'), EOF, or EOL c..
[리눅스] 서비스 등록 및 삭제
·
IT기술 관련/리눅스
출처: http://ezcocoa.com/?p=2376 http://www.ipwork.co.kr/index.php?document_srl=22398&mid=page_private 새로 시작하는 서비스를 등록하기 위해 스크립트 작성과 서비스 등록법을 설명한다. 해당 자료는 askubuntu.com에서 참조하였다. Init 스크립트#!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT IN..
[리눅스] inotify로 파일 시스템 활동 감시하기 (상)
·
IT기술 관련/리눅스
출처: http://www.test104.com/kr/tech/3800.html 직접 응용 프로그램을 작성하거나 오픈 소스 도구를 활용하거나 inotify는 읽기, 쓰기, 생성하기와 같은 파일 시스템 연산을 감시하는 리눅스(Linux®) 기능입니다. inotify는 반응성이 좋으며, 놀랍도록 사용하기 쉬우며, 크론 작업으로 바쁘게 폴링하는 경우보다 훨씬 더 효율적입니다. inotify를 응용 프로그램으로 통합하는 방식을 익히고 시스템 관리를 자동화하는 데 사용하는 명령행 도구 집합을 살펴봅시다. 시스템 관리는 일상 생활과 상당히 비슷하다. 세수하고 야채를 먹듯이, 자그마한 일상 유지 보수 작업은 기계를 제대로 돌아가게 만든다. 문서 꾸미기, 호출에 응답하기, 업데이트 내려받기, 프로세스 감시와 같은 작업..
[리눅스] 간단한 tail -f 구현
·
IT기술 관련/리눅스
http://www.opensource.apple.com/source/text_cmds/text_cmds-9/tail/tail.c 출처: http://jangpd007.tistory.com/17 kernel 2.6.1 이상이어야 함 이하는 dnotify 사용해야 함 #include #include #include #include #include #include #include #include #include int exitflag = 1; int main (int argc, char *argv[]) { if (argc == 1) { printf ("tail filename\n"); return 0; } char fname [256]; sprintf (fname, "%s", argv[1]); FILE *f..