pi@zerohertz-pi:~ $ sudo passwd root New password: Retype new password: passwd: password updated successfully pi@zerohertz-pi:~ $ sudo su root@zerohertz-pi:/home/pi# adduser zerohertz Adding user `zerohertz' ... Adding new group `zerohertz' (1001) ... Adding new user `zerohertz' (1001) with group `zerohertz' ... Creating home directory `/home/zerohertz' ... Copying files from `/etc/skel' ... New password: Retype new password: passwd: password updated successfully Changing the user information for zerohertz Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y root@zerohertz-pi:/home/pi# sudo adduser zerohertz sudo Adding user `zerohertz' to group `sudo' ... Adding user zerohertz to group sudo Done. root@zerohertz-pi:/home/pi# cat /etc/group | grep pi adm:x:4:pi dialout:x:20:pi cdrom:x:24:pi sudo:x:27:pi,zerohertz audio:x:29:pi video:x:44:pi plugdev:x:46:pi games:x:60:pi users:x:100:pi input:x:105:pi netdev:x:109:pi pi:x:1000: spi:x:999:pi i2c:x:998:pi gpio:x:997:pi root@zerohertz-pi:/home/pi# usermod -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,netdev,spi,i2c,gpio zerohertz root@zerohertz-pi:/home/pi# cat /etc/group | grep pi adm:x:4:pi,zerohertz dialout:x:20:pi,zerohertz cdrom:x:24:pi,zerohertz sudo:x:27:pi,zerohertz audio:x:29:pi,zerohertz video:x:44:pi,zerohertz plugdev:x:46:pi,zerohertz games:x:60:pi,zerohertz users:x:100:pi,zerohertz input:x:105:pi,zerohertz netdev:x:109:pi,zerohertz pi:x:1000: spi:x:999:pi,zerohertz i2c:x:998:pi,zerohertz gpio:x:997:pi,zerohertz root@zerohertz-pi:/home/pi# userdel -r -f pi userdel: user pi is currently used by process539 userdel: pi mail spool (/var/mail/pi) not found root@zerohertz-pi:/home/zerohertz# su zerohertz zerohertz@zerohertz-pi:~ $
위와 같이 새 사용자인 zerohertz로 로그인에 성공할 수 있음을 볼 수 있다. 또한, 새 사용자에게 모든 파일을 전송하고 싶다면 아래와 같이 실행하면 된다.
zerohertz@zerohertz-pi:/home $ sudo cp-a pi/. zerohertz/ zerohertz@zerohertz-pi:/home $ls pi zerohertz zerohertz@zerohertz-pi:/home $cd zerohertz/ zerohertz@zerohertz-pi:~ $ls-al total 68 drwxr-xr-x12 pi pi 4096 Sep 1909:36 . drwxr-xr-x4 root root 4096 Sep 1917:32 .. -rw-------1 pi pi 1484 Sep 1917:37 .bash_history -rw-r--r--1 pi pi 220 Aug 2011:31 .bash_logout -rw-r--r--1 pi pi 3523 Aug 2011:31 .bashrc drwxr-xr-x2 pi pi 4096 Aug 2011:40 Bookshelf drwx------3 pi pi 4096 Sep 1904:56 .cache drwx------4 pi pi 4096 Sep 1907:56 .config drwx------3 pi pi 4096 Aug 2012:09 .gnupg drwxr-xr-x2 pi pi 4096 Sep 1909:36 .ipynb_checkpoints drwxr-xr-x5 pi pi 4096 Sep 1905:01 .ipython drwx------2 pi pi 4096 Sep 1905:09 .jupyter drwxr-xr-x5 pi pi 4096 Sep 1904:56 .local -rw-r--r--1 pi pi 807 Aug 2011:31 .profile drwxr-xr-x4 pi pi 4096 Sep 1909:35 python_tutorial -rw-r--r--1 pi pi 180 Sep 1909:32 .wget-hsts drwxr-xr-x7 pi pi 4096 Sep 1904:58 zerohertz zerohertz@zerohertz-pi:~ $cd .. zerohertz@zerohertz-pi:/home $cd pi zerohertz@zerohertz-pi:/home/pi $ls-al total 68 drwxr-xr-x12 pi pi 4096 Sep 1909:36 . drwxr-xr-x4 root root 4096 Sep 1917:32 .. -rw-------1 pi pi 1484 Sep 1917:37 .bash_history -rw-r--r--1 pi pi 220 Aug 2011:31 .bash_logout -rw-r--r--1 pi pi 3523 Aug 2011:31 .bashrc drwxr-xr-x2 pi pi 4096 Aug 2011:40 Bookshelf drwx------3 pi pi 4096 Sep 1904:56 .cache drwx------4 pi pi 4096 Sep 1907:56 .config drwx------3 pi pi 4096 Aug 2012:09 .gnupg drwxr-xr-x2 pi pi 4096 Sep 1909:36 .ipynb_checkpoints drwxr-xr-x5 pi pi 4096 Sep 1905:01 .ipython drwx------2 pi pi 4096 Sep 1905:09 .jupyter drwxr-xr-x5 pi pi 4096 Sep 1904:56 .local -rw-r--r--1 pi pi 807 Aug 2011:31 .profile drwxr-xr-x4 pi pi 4096 Sep 1909:35 python_tutorial -rw-r--r--1 pi pi 180 Sep 1909:32 .wget-hsts drwxr-xr-x7 pi pi 4096 Sep 1904:58 zerohertz