[Samba] Fwd: Automatic mapping shares on logon time

jmpatagonia jmpatagonia at gmail.com
Mon Sep 28 12:21:09 UTC 2020


Hello finally I can solved the problem and map the share, just installing
the package "apt-get install cifs-utils" on the linux client,
Installing this just work.

Now, I figure out  how to map all shares that the user have.

The shares on almost users are always one "starting with the FS_xxxxx group
name that have been assigned", but in some case the user can have more than
one shares assigned. So I need to resolv on pam_mount how to map the user
clients 2 or more shares when they have2 or more FS_xxxx groups  assigned.

Example:
            share FS_PRUEBA1 -->  group -- GRUPO1
            share FS_PRUEBA2 -->  group -- GRUPO2
            share FS_PRUEBA3 -->  group -- GRUPO3

The user can have just GRUPO1 and mount FS_PRUEBA1 , or GRUPO1 and GRUPO2
and must mount FS_PRUEBA1 and FS_PRUEBA2

Regards.













El mié., 16 sept. 2020 a las 9:31, jmpatagonia (<jmpatagonia at gmail.com>)
escribió:

> Thanks Yvan , the first solution is that we are trying on the beginning
> using ldapsearch + gvfs-mount on the client,
>
> groups=($(ldapsearch -D "cn=Administrator,cn=Users,..................
> for group in "${groups[@]}";
> do
> case "$group" in
> echo "gvfs-mount smb://samba4/...................
>
> But the second pam_mount.conf we dont know exist, we will try this one.
>
> regards a lot,
>
>
>
>
> El mar., 15 sept. 2020 a las 5:20, Yvan Masson via samba (<
> samba at lists.samba.org>) escribió:
>
>> See answer at the bottom.
>>
>> Le 14/09/2020 à 15:56, jmpatagonia via samba a écrit :
>> > Yes sorry for my mistake, we need map share folders that the user have
>> > permission, at logon time on Linux Desktop User.
>> >
>> > And if for example a user change of departament or area, the shares
>> change,
>> > so we change the maps shares folders on logon.
>> >
>> > On Windows users is easy like GPO o logon script but on Linux Desktop
>> Users
>> > is more complex i think.
>> >
>> > regards.
>> >
>> >
>> >
>> >
>> >
>> > ---------- Forwarded message ---------
>> > De: jmpatagonia <jmpatagonia at gmail.com>
>> > Date: lun., 14 sept. 2020 a las 10:47
>> > Subject: Re: [Samba] Automatic mapping shares on logon time
>> > To: <samba at lists.samba.org>
>> >
>> >
>> > Sorry for my mistake, this work for linux users Right??
>> > We just need logon script for linux users for Windows users we have.
>> >
>> >
>> > El lun., 14 sept. 2020 a las 10:37, Carlos Jesus (<camjesus2 at gmail.com
>> >)
>> > escribió:
>> >
>> >> Hey,
>> >> You need to create a GPO.
>> >> There's a very good description here:
>> >> https://activedirectorypro.com/map-network-drives-with-group-policy/
>> >> You can map drive per user, per group or a combination, with or without
>> >> exclusions.
>> >> There is a mistake in the article; you should use %LogonUser% instead
>> of
>> >> %username%.
>> >>
>> >> Best regards
>> >>
>> >> jmpatagonia via samba <samba at lists.samba.org> escreveu no dia segunda,
>> >> 14/09/2020 à(s) 14:22:
>> >>
>> >>> Hello we are testing samba 4.11.2 and we try automatic mapping shares
>> >>> folders for users that their have permissions on fileserver, on the
>> logon
>> >>> time, like logon script on Windows.
>> >>>
>> >>> Any have a method to do this ?
>> >>>
>> >>> I explain, instead of the user go to "File Browser" and navigate and
>> map
>> >>> the share folders on the fileserver, we try to automatic map this
>> folders
>> >>> on logon time.
>> >>>
>> >>> regards.
>> >>>
>> >>> PD: We thinking in a complex method where the user guest the built-in
>> >>> samba4 ldap (ldap serach) for your groups and according the groups
>> that
>> >>> their have mapping the file sharing with gvfs-mount, because we
>> >>> implemented
>> >>> the pair same group-namex-share-namex.
>> >>> --
>> >>> To unsubscribe from this list go to the following URL and read the
>> >>> instructions:  https://lists.samba.org/mailman/options/samba
>> >>>
>> >>
>>
>> Hi,
>>
>> I think you have two solutions:
>> - using a custom script that runs on user login to query LDAP for
>> appropriate shares an which then uses "gio mount". Very flexible,
>> however gio is a user space mount, so bandwidth limited (I did that for
>> a school and it was working)
>> - using pam_mount.conf (/etc/security/pam_mount.conf.xml in Debian),
>> which I now think is the best solution. Read the man page for more
>> information and examples
>>
>> Regards,
>> Yvan
>>
>> --
>> To unsubscribe from this list go to the following URL and read the
>> instructions:  https://lists.samba.org/mailman/options/samba
>>
>


More information about the samba mailing list