D
D
Denis2019-02-22 09:52:16
linux
Denis, 2019-02-22 09:52:16

How to mount a Windows network share under Linux with logged in user rights?

Hello! Straight to the point.
Given:
0. Confident Windows user, not too confident Linux user.
1. MS Active Directory domain.
2. A computer running Linux (Astra Linux if it matters), entered into the domain (literally in a couple of clicks, respect to the developers).
3. When connecting (just connecting, not mounting, because if you run the mount command, then there is no connected folder in the command output) the network resource is connected with the necessary rights.
Required:
Mount (just mount so that it is visible with the mount command) network directory when a user logs in with the rights of this user.
The following command was found on the AstraLinux wiki:

//10.0.10.201/share /mnt cifs credentials=/root/.smbclient,rw,nosharesock,vers=1.0,soft,noperm 0 0
, where .smbclient file looks like:
username=samba_user_name
password=samba_user_password
domain=astra.ru

Everything works, but since different users can log on to the computer, explicitly specifying a file with credentials is not suitable. My first thought was to replace "/root/.smbclient" with "$HOME/.smbclient", however, when rereading the fstab file (command sudo mount -a), an unknown path message appears, i.e. the corresponding value is not inserted instead of $HOME. On reboot, the same story.
I fully admit that this is generally an incorrect assumption on my part, and in this way (using variables) it will still not work to mount the ball (especially if the mount is performed before the user logs in), and in this regard, I decided to ask my question here. What do you advise?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adamos, 2019-02-22
@Adamos

Create a mount point in the user's own folder (so that he has rights to it) and write mount to him in ~/.bashrc?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question