hallo Darac,

Darac Marjal <mailingl...@darac.org.uk> writes:
> On 01/04/2024 07:55, Felix Natter wrote:
>
>  hello debian-users,
>
> I configured autofs for /home:
>
> * -fstype=nfs,rw,soft,bg,intr SERVER:/share/&
>
> Just to point out that this is "/share", not "/home". You might have set 
> user's home directories to be /share/<username>, but you've not mentioned that
> explicitly.

you interpreted this wrongly: The whole config is for /home (defined in
/etc/auto.home and /etc/auto.misc or similar). The * means "any
username", and the right hand side is saying "mount SERVER:/share/$1 as
/home/$1" using NFS.

> But now the login as "admin" does not work any more, since
> it tries to mount SERVER:/share/admin -> Is it possible to exclude
> a user from automounting? 
>
> Probably the simplest method is to ensure that "admin"'s home directory isn't 
> below /share. You could keep that under /home, or make a new folder, as you
> prefer.

Ok, that is an idea: Change /etc/passwd so that "admin" gets the home
from /export/admins/admin. The (small) downside is that I potentially need
to do this for every admin around (In my "workaround" I can make
/etc/auto.home executable and use bash's wildcard matching).

> The workaround [1] I use is this:
>
> admin -fstype=nfs,rw,soft,bg,intr localhost:/export/admin_homes/&
> * -fstype=nfs,rw,soft,bg,intr SERVER:/share/&
>
> where /export/admin_homes/admin is just a normal directory.
>
> [1]
> https://serverfault.com/questions/245121/how-to-prevent-autofs-from-mounting-over-specific-directories
>
> Is this a valid solution? Will it work on Debian/Ubuntu/... also in the
> future?

Since I already did it that way: Can somebody please tell me whether my
"workaround" is valid?

> I use FreeIPA to manage my NFS home directories, and I've set my users there 
> to have home directories under /home/ipa/<username>. This means that
> non-FreeIPA users (i.e. if I need a machine-only user) have their homes under 
> /home/<username> which isn't NFS-mounted.

Yes, thanks (this is similar to your suggestion above). I would have do
it the other way around, i.e. keep the homes in /home, as users' Homes
depend on it.

Many Thanks and Best Regards,
Felix
-- 
Felix Natter
debian/rules!

Reply via email to