실습 - 사용자 계정 생성
User : tester UID : 1200 GID : tg Shell : sh HOME : /hosting Skel : /skelsam Auto Creating Directory : public_html Auto Creating File : .sam |
그룹생성
[root@localhost ~]#groupadd tg
디렉터리 hosting 생성
[root@localhost ~]# mkdir /hosting
[root@localhost ~]# ls -ld /hosting
drwxr-xr-x 2 root root 4096 2021-06-14 17:26 /hosting
skelsam 생성
[root@localhost ~]# cp -r /etc/skel /etc/skelsam
skelsam에 디렉터리,파일 추가
[root@localhost ~]# mkdir /etc/skelsam/public_html
[root@localhost ~]# touch /etc/skelsam/.sam
사용자 생성
[root@localhost ~]# useradd -u 1200 -g tg -s /bin/sh -d /hosting -mk /etc/skelsam testuser
확인
[root@localhost ~]# ls -al /hosting
합계 32
drwx------ 5 testuser tg 4096 2021-06-14 18:07 .
drwxr-xr-x 3 root root 4096 2021-06-14 18:07 ..
-rw-r--r-- 1 testuser tg 18 2021-06-14 17:28 .bash_logout
-rw-r--r-- 1 testuser tg 176 2021-06-14 17:28 .bash_profile
-rw-r--r-- 1 testuser tg 124 2021-06-14 17:28 .bashrc
drwxr-xr-x 2 testuser tg 4096 2021-06-14 17:28 .gnome2
drwxr-xr-x 4 testuser tg 4096 2021-06-14 17:28 .mozilla
-rw-r--r-- 1 testuser tg 0 2021-06-14 17:35 .sam
drwxr-xr-x 2 testuser tg 4096 2021-06-14 17:33 public_html
[root@localhost ~]# tail -1 /etc/passwd
testuser:x:1200:623::/hosting/testuser:/bin/sh
[root@localhost ~]# tail -1 /etc/group
tg:x:623:
+ 사용 가능한 shell 목록
cat /etc/shells
'운영체제' 카테고리의 다른 글
데몬과 xinetd 환경 설정, TCP Wrapper (0) | 2021.06.23 |
---|---|
프로세스 관리와 스케쥴링 (0) | 2021.06.22 |
Linux - MAC Address를 변경했을 때 (vm ware 환경) (0) | 2021.06.17 |
[Linux] ln - 파일 링크 (0) | 2021.06.17 |
[Linux] 계정과 그룹 관리 (0) | 2021.06.16 |