728x90
반응형
[Ubuntu Linux] 사용자 관리 |
$ cat /etc/passwd |
javanian@ubuntu:~$ cat /etc/passwd root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin man:x:6:12:man:/var/cache/man:/usr/sbin/nologin lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin mail:x:8:8:mail:/var/mail:/usr/sbin/nologin news:x:9:9:news:/var/spool/news:/usr/sbin/nologin uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin proxy:x:13:13:proxy:/bin:/usr/sbin/nologin www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin backup:x:34:34:backup:/var/backups:/usr/sbin/nologin list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin _apt:x:100:65534::/nonexistent:/usr/sbin/nologin systemd-network:x:101:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin systemd-resolve:x:102:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin messagebus:x:103:104::/nonexistent:/usr/sbin/nologin systemd-timesync:x:104:105:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin pollinate:x:105:1::/var/cache/pollinate:/bin/false sshd:x:106:65534::/run/sshd:/usr/sbin/nologin syslog:x:107:113::/home/syslog:/usr/sbin/nologin uuidd:x:108:114::/run/uuidd:/usr/sbin/nologin tcpdump:x:109:115::/nonexistent:/usr/sbin/nologin tss:x:110:116:TPM software stack,,,:/var/lib/tpm:/bin/false landscape:x:111:117::/var/lib/landscape:/usr/sbin/nologin usbmux:x:112:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin javanian:x:1000:1000:gilhong cho:/home/javanian:/bin/bash lxd:x:999:100::/var/snap/lxd/common/lxd:/bin/false ftp:x:113:119:ftp daemon,,,:/srv/ftp:/usr/sbin/nologin fwupd-refresh:x:114:120:fwupd-refresh user,,,:/run/systemd:/usr/sbin/nologin javanian@ubuntu:~$ |
$ tail -n5 /etc/passwd |
javanian@ubuntu:~$ tail -n5 /etc/passwd usbmux:x:112:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin javanian:x:1000:1000:gilhong cho:/home/javanian:/bin/bash lxd:x:999:100::/var/snap/lxd/common/lxd:/bin/false ftp:x:113:119:ftp daemon,,,:/srv/ftp:/usr/sbin/nologin fwupd-refresh:x:114:120:fwupd-refresh user,,,:/run/systemd:/usr/sbin/nologin javanian@ubuntu:~$ |
useradd |
javanian@ubuntu:/home$ sudo useradd javanian2 [sudo] password for javanian: javanian@ubuntu:/home$ |
javanian@ubuntu:/home$ tail -n6 /etc/passwd usbmux:x:112:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin javanian:x:1000:1000:gilhong cho:/home/javanian:/bin/bash lxd:x:999:100::/var/snap/lxd/common/lxd:/bin/false ftp:x:113:119:ftp daemon,,,:/srv/ftp:/usr/sbin/nologin fwupd-refresh:x:114:120:fwupd-refresh user,,,:/run/systemd:/usr/sbin/nologin javanian2:x:1001:1001::/home/javanian2:/bin/sh javanian@ubuntu:/home$ |
javanian@ubuntu:/$ su javanian2 Password: su: Authentication failure javanian@ubuntu:/$ |
$ sudo passwd javanian2 |
javanian@ubuntu:/$ sudo passwd javanian2 New password: Retype new password: passwd: password updated successfully javanian@ubuntu:/$ |
javanian@ubuntu:/$ su javanian2 Password: $ $ $ su javanian Password: javanian@ubuntu:/$ javanian@ubuntu:/$ sudo mkdir /home/javanian2 javanian@ubuntu:/$ cd home javanian@ubuntu:/home$ ll total 16 drwxr-xr-x 4 root root 4096 Mar 13 11:01 ./ drwxr-xr-x 19 root root 4096 Feb 15 03:43 ../ drwxrwxr-- 12 javanian javanian 4096 Mar 13 08:29 javanian/ drwxr-xr-x 2 root root 4096 Mar 13 11:01 javanian2/ javanian@ubuntu:/home$ ll total 16 drwxr-xr-x 4 root root 4096 Mar 13 11:01 ./ drwxr-xr-x 19 root root 4096 Feb 15 03:43 ../ drwxrwxr-- 12 javanian javanian 4096 Mar 13 08:29 javanian/ drwxr-xr-x 2 javanian2 root 4096 Mar 13 11:01 javanian2/ javanian@ubuntu:/home$ sudo chown javanian2:javanian2 /home/javanian2 javanian@ubuntu:/home$ ll total 16 drwxr-xr-x 4 root root 4096 Mar 13 11:01 ./ drwxr-xr-x 19 root root 4096 Feb 15 03:43 ../ drwxrwxr-- 12 javanian javanian 4096 Mar 13 08:29 javanian/ drwxr-xr-x 2 javanian2 javanian2 4096 Mar 13 11:01 javanian2/ javanian@ubuntu:/home$ |
useradd javanian3 tail -n7 /etc/passwd mkdir /home/javanian3 chown javanian3:javanian3 /home/javanian3 echo "javanian3 user added" |
useradd $1 tail -n7 /etc/passwd mkdir /home/$1 chown $1:$1 /home/$1 echo "$1 user added" |
usermod |
userdel |
728x90
반응형
'네트워크,서버,프로그래밍' 카테고리의 다른 글
[javascript] 단축키 ::: 키스트로크, keystroke (0) | 2023.02.28 |
---|---|
[Ubuntu Linux] Linux(Unix) 파일링크 사용하기 - 바로가기 (0) | 2023.02.24 |
[Ubuntu Linux] jdk 환경(PATH) 설정 및 톰켓 서버 실행하기 (0) | 2023.02.21 |
[Ubuntu Linux] Linux(Unix)에 압축본 JDK 설치하기 (0) | 2023.02.21 |
[Ubuntu Linux] 톰캣 서버 설치하기 (0) | 2023.02.21 |