dscl

Daniel J. Luke dluke at geeklair.net
Fri Sep 18 06:53:45 PDT 2009


On Sep 17, 2009, at 9:44 PM, Scott Haneda wrote:
> Hello, I am working on trying to make a change to a port that does  
> not have user and group adding abilities, but it probably should.   
> At this point, I need to confirm this by adding a user and group by  
> hand, using dscl in Mac OS X 10.5

The port should use the adduser/addgroup commands (see 'man portfile')

> I took this from some old docs on dovecot:
> sudo dscl . -create /Groups/_ftpg
> sudo dscl . -create /Groups/_ftpg UniqueID 490
> sudo dscl . -create /Users/_ftpu
> sudo dscl . -create /Users/_ftpu UserShell /usr/bin/false
> sudo dscl . -create /Users/_ftpu RealName "PureFTPd FTP Server"
> sudo dscl . -create /Users/_ftpu UniqueID 490
> sudo dscl . -create /Users/_ftpu PrimaryGroupID 490
> sudo dscl . -create /Users/_ftpu NFSHomeDirectory /var/empty
>
> This sort of works.  In this case, the ftpd has a flag to "auto  
> create home dirs", which I have enabled.  I have told the ftpd to  
> use user and group 490.  On first ftp login, it will create the  
> directory I tell it to:
>
> drwxr-x---  2 _ftpu   490     68 Sep 17 18:42 someplace
>
> As you can see, there is something wrong with the group.

You didn't set PrimaryGroupID

> $sudo chgrp _ftpg someplace/
> drwxr-x---  2 _ftpu   nobody   68 Sep 17 18:42 someplace
>
> I think what I would really like to do is also create a user and  
> group more like www and mysql, where they have both the _foo and foo  
> version, but I can not figure this out.

why? I don't think you want/need to have the user be 'special' in this  
way.

--
Daniel J. Luke
+========================================================+
| *---------------- dluke at geeklair.net ----------------* |
| *-------------- http://www.geeklair.net -------------* |
+========================================================+
|   Opinions expressed are mine and do not necessarily   |
|          reflect the opinions of my employer.          |
+========================================================+





More information about the macports-dev mailing list