posted by 귀염둥이채원 2018. 11. 27. 15:51

1. 유저관리

1) useradd : 유저생성 

기본형식

#useradd [옵션] [유저명]

-G, --groups GROUPS

-d, --home-dir HOME_DIR

-s, --shell SHELL

-u, --uid UID

-g, --gid 새로운초기 로그인 그룹 존재하는 그룹이어야함

-c, --comment COMMENT

-o, --non-unique 사용중인 UID 다른 유저에게 할당

-r, --system 100이하의 시스템 계정 생성시

-e, --expiredate EXPIRE_DATE(YYYY-MM-DD)

 

# useradd -rou 0 -g 0 -d /root -c "test usertest

# useradd -e 2015-08-31 -G test,root -c "test user" -s /bin/csh test

 

2) userdel : 유저삭제

기본형식 

userdel [옵션유저명

-r, --remove remove home directory and mail spool

 

# userdel -r test

 

3) usermod : 유저변경

usermod [옵션유저명

-a, --append 그룹에 유저추가시 사용 -G 옵션이랑 같이 써야함.

-G, --groups GROUPS

-d, --home-dir HOME_DIR

-s, --shell SHELL

-u, --uid UID

-g, --gid 새로운초기 로그인 그룹 존재하는 그룹이어야함

-c, --comment COMMENT

-o, --non-unique 사용중인 UID 다른 유저에게 할당

-r, --system 100이하의 시스템 계정 생성시

-e, --expiredate EXPIRE_DATE(YYYY-MM-DD)

-l, --login NEW_LOGIN

-L, --lock

-U, --unlock

 

# groupadd myproject

# usermod -a -G myproject test

 

2. 그룹관리

1) 그룹생성 : groupadd

groupadd [options] GROUP

-g, --gid GID

 

# groupadd -g 700 project

 

2)그룹삭제 : groupdel

# groupdel project

 

3) 그룹변경 : groupmod

# groupmod -n myproject project


posted by 귀염둥이채원 2018. 11. 27. 14:20

vim 를 사용하다 보면 자주 부딪치게 되는 문제가 인코딩이다. 

파일을 열었더니 문자가 도저히 알아 볼 수 없는 그런 외계어로 되어있다면 바로 아래방법을 사용하시면 됩니다.


현재 보이는 문자의 인코딩을 수정하는 방법

:e ++enc=utf-8

:e ++enc=euc-kr


현재 파일의 인코딩을 수정하는 방법

:set fileencoding=utf-8

:set fileencoding=euc-kr

posted by 귀염둥이채원 2018. 11. 27. 11:33

# rsync 특정 파일 제외하기

password.txt 파일은 rsync 동기화 시에 제외하기


$ rsync -avz --delete --exclude="password.txt" root@192.168.1.1:/var/www/html/ /var/www/html/


rsync 특정 폴더 제외하기

.svn 폴더는 rsync 동기화 시에 제외하기


$ rsync -avz --delete --exclude=".svn" root@192.168.1.1:/var/www/html/ /var/www/html/



# rsync 특정 파일&폴더 제외하기

$ rsync -avz --delete --exclude="password.txt" --exclude=".svn" root@192.168.1.1:/var/www/html/ /var/www/html/

1 ··· 74 75 76 77 78 79 80 81