osx 㧠useradd, groupadd
% man dscla
ã¦ã¼ã¶ä¸è¦§
% dscl . -list /Users UniqueID | sort -n -k 2
ã°ã«ã¼ãä¸è¦§
% dscl . -list /Groups PrimaryGroupID | sort -n -k 2
使ç¨ã§ããGIDãåå¾
% NEWGID=$(expr $(dscacheutil -q group | awk '{print $2}' | sort -ug | tail -1) + 1)
$ groupadd -g $NEWGID hoge
% sudo dscl . -create /Groups/hoge gid $NEWGID
$ useradd -u 600 -g $NEWGID -s /sbin/nologin -d /Users/hoge hoge
ã¨ãããããUID500çªå°ã¯é¿ãã¨ã
% sudo dscl . -create /Users/hoge % sudo dscl . -create /Users/hoge UserShell /sbin/nologin % sudo dscl . -create /Users/hoge RealName 'hoge' % sudo dscl . -create /Users/hoge UniqueID 600 % sudo dscl . -create /Users/hoge PrimaryGroupID $NEWGID % sudo dscl . -create /Users/hoge NFSHomeDirectory /Users/hoge
ä¸è¨ã§ã¯ããã¼ã ãã£ã¬ã¯ããªãä½æãããªãã®ã§ãå®éã«å¿ è¦ãªå ´å
% sudo createhomedir -b -u hoge
ãã¹ã¯ã¼ãè¨å®
% sudo passwd hoge