Hitchhiker's Guide to Openbsd


uRJZXUkOghbieIvSWXVJRzlq' -u 1002 \


Download 1.27 Mb.
Pdf ko'rish
bet150/258
Sana04.04.2023
Hajmi1.27 Mb.
#1328980
1   ...   146   147   148   149   150   151   152   153   ...   258
Bog'liq
obsd-faq49

uRJZXUkOghbieIvSWXVJRzlq' -u 1002 \
-s /bin/ksh -c "Test FAQ User" -m -g guest testuser
Note: Make sure to use ' ' (single quotes) around the password string, not " " (double quotes) as the shell 
will interpret these before sending it to user(8). In addition to that, make sure you specify the -m option if 
you want the user's home directory created and the files from /etc/skel copied over. 
To see that the user was created correctly, we can use many different utilities. Below are a few commands 
you can use to quickly check that everything was created correctly. 
ls -la /home
http://www.openbsd.org/faq/faq10.html (11 of 32)9/4/2011 10:02:15 AM


10 - System Management
total 14
drwxr-xr-x 5 root wheel 512 May 12 14:29 .
drwxr-xr-x 15 root wheel 512 Apr 25 20:52 ..
drwxr-xr-x 24 ericj wheel 2560 May 12 13:38 ericj
drwxr-xr-x 2 testuser guest 512 May 12 14:28 testuser
id testuser
uid=1002(testuser) gid=31(guest) groups=31(guest)
finger testuser
Login: testuser Name: Test FAQ User
Directory: /home/testuser Shell: /bin/ksh
Last login Sat Apr 22 16:05 (EDT) on ttyC2
No Mail.
No Plan.
In addition to these commands, user(8) provides its own utility to show user characteristics, called userinfo
(8). 
userinfo testuser
login testuser
passwd *
uid 1002
groups guest
change Wed Dec 31 19:00:00 1969
class
gecos Test FAQ User
dir /home/testuser
shell /bin/ksh
expire Wed Dec 31 19:00:00 1969
Removing users
To remove users with the user(8) hierarchy of commands, you will use userdel(8). This is a very simple, 
yet usable command. To remove the user created in the last example, simply: 
userdel -r testuser
Notice the -r option, which must be specified if you want the users home directory to be deleted as well. 
Alternatively, you can specify -p and not -r and this will lock the user's account, but not remove any 
information. 

Download 1.27 Mb.

Do'stlaringiz bilan baham:
1   ...   146   147   148   149   150   151   152   153   ...   258




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling