<div dir="ltr">You could just stick with adduser:<div><br></div><div># adduser --shell /bin/false --gid <GID_OF_users> --gecos 'Fantasio' fantasio<br><br>As another alternative, edit  /etc/login.defs   which is the config file for useradd</div>
<div><br></div><div>and set</div><div><br></div><div>UMASK 027</div><div><br></div><div>which should give you 0750 permissions on the users home directory when you create it with the useradd command.</div><div><br></div><div>
<br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 16, 2014 at 8:40 AM, Niki Kovacs <span dir="ltr"><<a href="mailto:info@microlinux.fr" target="_blank">info@microlinux.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I want to set home directory permissions for newly created users to 0750. Instead of having to manually chmod 0750, I found out I could edit this behaviour in /etc/adduser.conf:<br>
<br>
DIR_MODE=0750<br>
<br>
Now here's a more tricky question. I have to create a series of users without shell access. What I'd usually do is something like this:<br>
<br>
# useradd -m -g users -s /bin/false -c "Fantasio" fantasio<br>
# useradd -m -g users -s /bin/false -c "Gaston Lagaffe" glagaffe<br>
# useradd -m -g users -s /bin/false -c "Gaston Lagaffe" glagaffe2<br>
# useradd -m -g users -s /bin/false -c "Jeanne Dupont" jdupont<br>
# useradd -m -g users -s /bin/false -c "Bertrand Labévue" blabevue<br>
<br>
Unfortunately my DIR_MODE=0750 directive is not operative, and these users' home directories get created with default 0755 permissions.<br>
<br>
Any idea if there's a secret trick or switch so they're directly created with 0750 permissions?<br>
<br>
Cheers,<br>
<br>
Niki<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Microlinux - Solutions informatiques 100% Linux et logiciels libres<br>
7, place de l'église - 30730 Montpezat<br>
Web  : <a href="http://www.microlinux.fr" target="_blank">http://www.microlinux.fr</a><br>
Mail : <a href="mailto:info@microlinux.fr" target="_blank">info@microlinux.fr</a><br>
Tél. : 04 66 63 10 32<br>
<br>
-- <br>
ubuntu-users mailing list<br>
<a href="mailto:ubuntu-users@lists.ubuntu.com" target="_blank">ubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users" target="_blank">https://lists.ubuntu.com/<u></u>mailman/listinfo/ubuntu-users</a><br>
</font></span></blockquote></div><br></div>