티스토리 툴바


분류없음2012/01/25 10:08
centos 에서 사용자 비밀번호 변경 기간 설정.

[root@localhost ~]# vi /etc/login.defs

PASS_MAX_DAYS   90  ## 패스워드 변경 없이 사용 가능한 최대 기간

PASS_MIN_DAYS   1   ## 패스워드 변경 없이 사용 가능한 최소 기간
PASS_MIN_LEN    8   ## 최소 길이
PASS_WARN_AGE   7   ## 만료되기 전 알림 주기 ( -7 )


 
크리에이티브 커먼즈 라이선스
Creative Commons License
Posted by 없음 czar.
분류없음2012/01/13 10:00
centos 에서 sudoers 설정


관리자로 로그인 후 추가할 아이디가 hahaha 인 경우

$vi /etc/sudoers

## Allow root to run any commands anywhere
root           ALL=(ALL)       ALL
hahaha         ALL=(ALL)       ALL          <= 추가

 


## Same thing without a password <=== 비밀번호 물어보지 않게
#%wheel  ALL=(ALL)       NOPASSWD: ALL 

주석제거


저장후 빠져나옴.


그리고 
wheel 그룹에 hahaha 사용자 추가

$vi /etc/group
중간쯤~~
wheel:x:10:root,hahaha        <== 사용자추가

저장.


hahaha 사용자로 로그인 후 
sudo tail /etc/sudoers 하면

$ sudo tail /etc/sudoers
[sudo] password for devtainer:
# %wheel        ALL=(ALL)       NOPASSWD: ALL

## Allows members of the users group to mount and unmount the
## cdrom as root
# %users  ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom

## Allows members of the users group to shutdown this system
# %users  localhost=/sbin/shutdown -h now
hahaha       ALL=(ALL)       ALL

이렇게 나오면 정상

sudo: /etc/sudoers is mode 0640, should be 0440 
sudo: no valid sudoers sources found, quitting
 
 
이렇게 나오면 퍼미션 에러
chmod u-w /etc/sudoers
퍼미션을 440으로 변경해준다.  
크리에이티브 커먼즈 라이선스
Creative Commons License
Posted by 없음 czar.