W
W
Wadik_Wadkovich2018-05-29 14:48:37
linux
Wadik_Wadkovich, 2018-05-29 14:48:37

How to automatically mount a folder after user authorization?

There is a domain on samba4. Users successfully automate on machines. I want to do what would be with the author. domain user in linux, the folder of the same name was mounted. For example, the server has //share/admin and //share/user. When authorizing the admin user, //share/admin should be mounted with the specified login and password during authorization.
sudo mount -t cifs -o username=$USER,password=$PASSWD,cruid=$USER,sec=krb5 //share/admin /mnt seems to work, but it doesn't work in fstab + how to specify destination directory by type //share /%LogonUser% ?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexey Cheremisin, 2018-05-29
@leahch

Actually https://kb.etersoft.ru/Pam_mount

L
latush, 2018-05-29
@latush

mount to ~/.bashrc
directory specify //share/$(whoami)

D
Dmitry Aleksandrov, 2018-05-29
@jamakasi666

autofs.

A
Andrej Gessel, 2018-08-06
@andiges

A little late with the answer, but I think it will be useful: https://wiki.samba.org/index.php/User_Home_Folders

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question