« Previous : 1 : 2 : 3 : 4 : 5 : Next »
1. 계정의 expire 설정하기 ( usermod )

전체 적용 : /etc/login.def 파일 편집

참고 사이트 1 : http://tong.nate.com/mahyun/36502095

ex)

usermod -e YYYY-MM-DD ID

cat /etc/shadow 에 보시면 8번째 항목이 expire date 이다.

추가 옵션 :

-n 패스워드 변경까지의 최단 날짜의 설정
-x 현재 패스워드의 유효기간을 지정한다.
-w 패스워드 만료 전 경고 날짜를 지정한다.
-i
패스워드 만료된 뒤에 사용자 계정사용이 불가능하게 하기
까지의 기간을 설정한다.

2. 계정 잠금 설정하기 ( faillog )

참고 사이트 1 : http://blog.naver.com/sulla_now?Redirect=Log&logNo=140027805370

참고 사이트 2 : http://wiki.kldp.org/wiki.php/DocbookSgml/PAM_admin-TRANS


위의 내용을 보면  /etc/pam.d/system-auth 에 아래의 2 라인을 추가 한다.

#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.

auth        required      pam_env.so
auth        required      pam_tally2.so onerr=fail deny=3
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet
auth        required      pam_deny.so

account     required      pam_unix.so
account     required      pam_tally2.so onerr=fail
account     sufficient    pam_succeed_if.so uid < 500 quiet
account     required      pam_permit.so

password    requisite     pam_cracklib.so try_first_pass retry=3
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so

추가가 완료되면

  pam_tally2 명령을 이용하여 현재 실패한 횟수를 체크하고

/var/log/secure 에 pam_tally2(sshd:auth): user yjj1 (6005) tally 4, deny 3

위와 같은 secure 로그를 뿌려준다.

lock 걸려있는 사용자의 해제 방법은  pam_tally2 --user id -r 이며,

자세한 내용은 위의 참고 사이트에서 확인 하시기 바랍니다.

추가적으로 pam_cracklib 모듈을 이용하여 패스워드의 정규 표현식도 구현이 가능하다
ex)
password    required      /lib/security/$ISA/pam_cracklib.so retry=3 minlen=8 ocredit=-1 dcredit=-1

retry=N
    Prompt user at most N times before returning with error. The default is 1

minlen=N
    The minimum acceptable size for the new password (plus one if credits are
    not disabled which is the default). In addition to the number of characters
    in the new password, credit (of +1 in length) is given for each different
    kind of character (other, upper, lower and digit). The default for this
    parameter is 9 which is good for a old style UNIX password all of the same
    type of character but may be too low to exploit the added security of a md5
    system. Note that there is a pair of length limits in Cracklib itself, a
    "way too short" limit of 4 which is hard coded in and a defined limit (6)
    that will be checked without reference to minlen. If you want to allow
    passwords as short as 5 characters you should not use this module.


ocredit=N

    (N >= 0) This is the maximum credit for having other characters in the new
    password. If you have less than or N other characters, each character will
    count +1 towards meeting the current minlen value. The default for ocredit
    is 1 which is the recommended value for minlen less than 10.

    (N < 0) This is the minimum number of other characters that must be met for
    a new password.

dcredit=N

    (N >= 0) This is the maximum credit for having digits in the new password.
    If you have less than or N digits, each digit will count +1 towards meeting
    the current minlen value. The default for dcredit is 1 which is the
    recommended value for minlen less than 10.

    (N < 0) This is the minimum number of digits that must be met for a new
    password.


크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/12/17 17:45 2008/12/17 17:45
, , , , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/586

Trackback URL : http://blog.blog.n-nuri.com/trackback/586

Leave a comment
[로그인][오픈아이디란?]
name server 에서 누군가가 나의 서버를 이용해서 query 를 날리는 내용을 확인하고 싶을때가 있다.

그러기 위해선 query log 를 남겨야 되는데 여기서 주의 할점은 chroot 이다.

chroot 가 적용되지 않은 시스템은 query log 경로를 아무 곳이나 정해도 상관 없지만.

만약 chroot 를 적용한 시스템이라면 /var/named/chroot 가 최상위 디렉토리라는 것을 명심하자

/etc/named.conf 에 query log 관련 셋팅

logging {
        category lame-servers { null; };
        category notify { null; };
        channel "query_logging" {
            file "/var/log/query_log" versions 3 size 100M;
            print-time yes;              
            print-category yes;
            print-severity yes;
        };

        category queries {
        query_logging;
        };
};

위 처럼 설정 한 후 query_log 파일을 만든다. 권한은 named(user),named(group) 

실제 경로 /var/named/chroot/var/log 이지만 named 의 최상위 경로가 /var/named/chroot 이기 때문에 file 항목에 "/var/named/chroot" 는 입력하지 않아도 된다.

만약 file 항목의 경로가 잘못되면 /var/log/messages 항목에 file not found 등의 메시지를 출력 한다.

위 항목을 적용 후 query_log 의 내용을 확인해서 log 가 정상적으로 쌓이면 정상이다.


크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/10/09 15:46 2008/10/09 15:46
, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/573

Trackback URL : http://blog.blog.n-nuri.com/trackback/573

Leave a comment
[로그인][오픈아이디란?]
RHEL의 vsftpd 는 기본적으로 standalone 모드로 동작 한다.

그런데 만약 xinetd 모드로 동작을 해야 한다면

/etc/xinetd.d/이름
ex) /etc/xinetd.d/ftpd
파일을 만들고 아래의 내용을 입력 한다.

service ftp
{
       socket_type     = stream
       wait            = no
       user            = root
       server          = /usr/sbin/vsftpd
       log_on_failure  += USERID
       disable         = no
}

그리고 /etc/vsftpd/vsftpd.conf 에

listen=YES <== 주석 처리

여기서 주의 할점은 기존 vsftpd 데몬은 꼭 off 시키고 runlevel 에서도 off 시켜야 한다.

아래의 netstat 정보로 확인 가능

netstat -ntlp ## standalone 모드
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      6521/vsftpd    
netstat -ntlp ## xinetd 모드
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      6486/xinetd 
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/08/11 12:05 2008/08/11 12:05
, , , , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/556

Trackback URL : http://blog.blog.n-nuri.com/trackback/556

Leave a comment
[로그인][오픈아이디란?]

[Linux] df -k 에서의 use % 계산 방법

일반적으로 Used / Total = ??? % 라고 생각을 하겠지만

file system mechanism 에서의 계산 방식의 차이로 생각지도 않은 계산 방식이 나온다.

각 파일 시스템일 만들때 약 5% 정도의 hidden size가 존재 하며 해당 내용의 공식은
Used + Availble / Total = ??? 하시면 약 0.94xxxxxx ( 약 5% ) 로 확인이 가능하며  이 5%가 위의 계산식과 차이가 나는 주요 원인 이다.

그럼 어떻게 계산을 해야 될까???

free size = available * 100 / nonroot_total(used + available)

이렇게 하면 free size 가 나오며 이걸 - 100 하면 used 공간 % 가 나온다.

관련해서 소스와 참고 사이트를 올린다.

참고 사이트 :
http://fedoraforum.org/forum/showthread.php?t=194912



크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/08/06 17:31 2008/08/06 17:31
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/553

Trackback URL : http://blog.blog.n-nuri.com/trackback/553

Leave a comment
[로그인][오픈아이디란?]

[Linux] 시리얼 콘솔에 화면 뿌려주기

예를들어 아이테니엄 장비나 ATCA 장비 같은경우 VGA 콘솔이 없는 경우가 있다.

이럴경우 Serial Console 를 통하여 OS 설치를 하여야 되는데

이럴 경우 RedHat 기준???

1번 시디를 넣고 boot: 프롬프트가 떨어질때

linux console=ttyS0, 115200n8

처럼 입력하면 된다 ttyS0 는 시리얼 콘솔의 번호 이며 보통 서버측의 Serial 을 사용한다.

115200 n 8 은 속도와 비트수 등등의 정보를 입력하면 된다.

위와 연동해서 아래 게시물처럼 VNC 도 사용 할 수 있다.
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/07/08 10:59 2008/07/08 10:59
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/545

Trackback URL : http://blog.blog.n-nuri.com/trackback/545

Leave a comment
[로그인][오픈아이디란?]

[Linux] RedHat VNC로 설치 하기

설치할때 VNC 사용하기

화면을 뿌려줄 시스템엔 vncview -listen 을 실행시켜 놓는다.

그리고 해당 시스템엔

CD나 기타 미디어를 이용하여

boot: 이나??? pxe 부팅을 할경우엔 부팅 커널을 선택할때

linux vnc vncconnect=ip:Listen_Port ( 화면을 뿌려줄 시스템에서 vncview -listen 하면 해당 포트가 나온다 )

console=ttyS0 은 화면을 시리얼 포트에 뿌려준다는 내용

vncpassword= vnc의 접속 패스워드를 넣는다.

진행 하다가 IP 까지 받아오면 vnc가 뜬다.

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/07/07 17:15 2008/07/07 17:15
, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/544

Trackback URL : http://blog.blog.n-nuri.com/trackback/544

Leave a comment
[로그인][오픈아이디란?]
ex) top -b -n5 -d5 > /tmp/top.txt

top 실행 명령어

       -b : Batch mode operation
            Starts top in ’Batch mode’, which could be useful for sending out-
            put from top to other programs or to a file.  In  this  mode,  top
            will  not  accept input and runs until the iterations limit you’ve
            set with the ’-n’ command-line option or until killed.


       -n : Number of iterations limit as:  -n number
            Specifies the maximum number of iterations, or frames, top  should
            produce before ending.


       -d : Delay time interval as:  -d ss.tt (seconds.tenths)
            Specifies the delay between screen updates, and overrides the cor-
            responding value in  one’s  personal  configuration  file  or  the
            startup  default.   Later  this can be changed with the ’d’ or ’s’
            interactive commands.



크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/06/09 14:23 2008/06/09 14:23
,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/534

Trackback URL : http://blog.blog.n-nuri.com/trackback/534

Leave a comment
[로그인][오픈아이디란?]

[Linux] 시스템 정보 보기 DMIDECODE

출처 : RHEL5 man page

DMIDECODE(8)                                                      DMIDECODE(8)

NAME
       dmidecode - DMI table decoder

SYNOPSIS
       dmidecode [OPTIONS]

DESCRIPTION
       dmidecode  is  a  tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a
       description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and  BIOS  revi-
       sion.  Thanks  to this table, you can retrieve this information without having to probe for the actual hardware.  While this is a good
       point in terms of report speed and safeness, this also makes the presented information possibly unreliable.

       The DMI table doesn’t only describe what the system is currently made of, it also can report the  possible  evolutions  (such  as  the
       fastest supported CPU or the maximal amount of memory supported).

       SMBIOS  stands  for  System Management BIOS, while DMI stands for Desktop Management Interface. Both standards are tightly related and
       developed by the DMTF (Desktop Management Task Force).

       As you run it, dmidecode will try to locate the DMI table. If it succeeds, it will then parse this table and display a list of records
       like this one:

       Handle 0x0002
           DMI type 2, 8 bytes.
           Base Board Information
               Manufacturer: Intel
               Product Name: C440GX+
               Version: 727281-001
               Serial Number: INCY92700942

       Each record has:

       · A  handle.  This is a unique identifier, which allows records to reference each other. For example, processor records usually refer-
         ence cache memory records using their handles.

       · A type. The SMBIOS specification defines different types of elements a computer can be made of. In this  example,  the  type  is  2,
         which means that the record contains "Base Board Information".

       · A  size.  Each  record  has a 4-byte header (2 for the handle, 1 for the type, 1 for the size), the rest is used by the record data.
         This value doesn’t take text strings into account (these are placed at the end of the record), so the actual length  of  the  record
         may be (and is often) greater than the displayed value.

       · Decoded  values.  The  information presented of course depends on the type of record. Here, we learn about the board’s manufacturer,
         model, version and serial number.
OPTIONS
       -d, --dev-mem FILE
              Read memory from device FILE (default: /dev/mem)

       -q, --quiet
              Be less verbose. Unknown, inactive and OEM-specific entries are not displayed. Meta-data  and  handle  references  are  hidden.
              Mutually exclusive with --dump.

       -s, --string KEYWORD
              Only  display  the value of the DMI string identified by KEYWORD.  KEYWORD must be a keyword from the following list: bios-ven-
              dor, bios-version, bios-release-date, system-manufacturer,  system-product-name,  system-version,  system-serial-number,  base-
              board-manufacturer,  baseboard-product-name,  baseboard-version, baseboard-serial-number, baseboard-asset-tag, chassis-manufac-
              turer, chassis-version, chassis-serial-number, chassis-asset-tag, processor-manufacturer, processor-version.  Each keyword cor-
              responds  to  a given DMI type and a given offset within this entry type.  Not all strings may be meaningful or even defined on
              all systems. Some keywords may return more than one result on some systems (e.g.  processor-version on a  multi-processor  sys-
              tem).   If  KEYWORD  is  not  provided or not valid, a list of all valid keywords is printed and dmidecode exits with an error.
              This option cannot be used more than once, and implies --quiet.  Mutually exclusive with --type and --dump.

       -t, --type TYPE
              Only display the entries of type TYPE. TYPE can be either a DMI type number, or a comma-separated list of type  numbers,  or  a
              keyword  from the following list: bios, system, baseboard, chassis, processor, memory, cache, connector, slot. Refer to the DMI
              TYPES section below for details.  If this option is used more than once, the set of displayed entries will be the union of  all
              the  given  types.   If  TYPE is not provided or not valid, a list of all valid keywords is printed and dmidecode exits with an
              error.  Mutually exclusive with --string.

       -u, --dump
              Do not decode the entries, dump their contents as hexadecimal instead.  Note that this is still a text output, no  binary  data
              will  be thrown upon you. The strings attached to each entry are displayed as both hexadecimal and ASCII. This option is mainly
              useful for debugging.  Mutually exclusive with --quiet and --string.

       -h, --help
              Display usage information and exit

       -V, --version
              Display the version and exit
DMI TYPES
       The SMBIOS specification defines the following DMI types:

       Type   Information
       ----------------------------------------
          0   BIOS
          1   System
          2   Base Board
          3   Chassis
          4   Processor
          5   Memory Controller
          6   Memory Module
          7   Cache
          8   Port Connector
          9   System Slots
         10   On Board Devices
         11   OEM Strings
         12   System Configuration Options
         13   BIOS Language
         14   Group Associations
         15   System Event Log
         16   Physical Memory Array
         17   Memory Device
         18   32-bit Memory Error
         19   Memory Array Mapped Address
         20   Memory Device Mapped Address
         21   Built-in Pointing Device
         22   Portable Battery
         23   System Reset
         24   Hardware Security
         25   System Power Controls
         26   Voltage Probe
         27   Cooling Device
         28   Temperature Probe
         29   Electrical Current Probe
         30   Out-of-band Remote Access
         31   Boot Integrity Services
         32   System Boot
         33   64-bit Memory Error
         34   Management Device
         35   Management Device Component
         36   Management Device Threshold Data
         37   Memory Channel
         38   IPMI Device
         39   Power Supply

Additionally, type 126 is used for disabled entries, type 127 is an end-of-table marker, and types 128 to  255  are  for  OEM-specific
       data.  dmidecode will display these entries by default, but cannot decode them.

       Keywords can be used instead of type numbers with --type.  Each keyword is equivalent to a list of type numbers:

       Keyword     Types
       ------------------------------
       bios        0, 13
       system      1, 12, 15, 23, 32
       baseboard   2, 10
       chassis     3
       processor   4
       memory      5, 6, 16, 17
       cache       7
       connector   8
       slot        9

       Keywords are matched case-insensitively. The following command lines are equivalent:

       · dmidecode --type 0 --type 13

       · dmidecode --type 0,13

       · dmidecode --type bios

       · dmidecode --type BIOS

FILES
       /dev/mem

BUGS
       More often than not, information contained in the DMI tables is inaccurate, incomplete or simply wrong.

AUTHORS
       Alan Cox, Jean Delvare

SEE ALSO
       biosdecode(8), mem(4), ownership(8), vpddecode(8)

dmidecode                         August 2005                     DMIDECODE(8)

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/04/22 12:43 2008/04/22 12:43
, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/524

Trackback URL : http://blog.blog.n-nuri.com/trackback/524

Leave a comment
[로그인][오픈아이디란?]

[Linux] debian etch sar 활성화...

일반 RHEL 기반은 기본으로 sar 가 활성화 되어있어서
10분마다 게더링을 하지만

debian etch 시스템은 기본으로 비 활성화 되어 있는걸 오늘 알았다.

/etc/cron.d/sysstat 의 아래 항목을 변경해주면 10분마다 데이터를 게더링 하게 된다.

#ENABLED=false
ENABLED=true

- 추가 -  080411

그러나... /etc/default/sysstat 에

ENABLED="true" 옵션이 또 있다... ㅡ.ㅡ 어쩌라는건가???

일단 2개 다 true로 활성화 하고선 saxx 파일이 정상적으로 생성 되었다


크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/04/10 16:36 2008/04/10 16:36
, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/520

Trackback URL : http://blog.blog.n-nuri.com/trackback/520

Leave a comment
[로그인][오픈아이디란?]
yum 이나 apt-get 등등 여러가지가 있겠지만...

git 를 이용하여 패키지를 다운받는 경우가 생긴다.

rhel5 기준으로 git를 yum 에 등록 시키고 설치 할려구 해도

도저히 모를때...

해당 패키지를 검색해 보길 바란다.

tla 와 cvsps

혹시 위 2개의 패키지가 설치되어 있지 않다면 설치를 해줘야 git 패키지를 사용 할 수 있다.

08.09.23 변경 사항

git.repo 로 yum 설치가 안 될경우 rpmforge.net 사이트의 rpmforge.repo 를 이용해서

설치 하시기 바랍니다.

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/03/15 11:44 2008/03/15 11:44
,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/514

Trackback URL : http://blog.blog.n-nuri.com/trackback/514

Leave a comment
[로그인][오픈아이디란?]
« Previous : 1 : 2 : 3 : 4 : 5 : Next »

블로그 이미지

http://blog.n-nuri.com 이 접속이 안 될경우 http://x2x.dnip.net 으로 접속해 주세요 공유하지 않는 지식은 썩은 물과 같다~~~!!!

- 삐꾸강아쥐