sharky
Sun May 21, 2017 7:43:13 am
Hi,
I take advantage of this platform since it is the OS that I use by cons against my problem is more general under Linux.
I want to make a Logon script for mount remote share from NAS. 1 script for all.
I can't use FSTAB, because the NAS HOME folder is not same for each computer user.
What I did and my idea:
I use this line
I create /home/$USER/.$USER_cred with user NAS credentials (user + pass)
When i start my script and give sudo password, it's work.
I have push my script in /etc/profile.d/mountnas.sh
With "sudo mount.cifs" i need to give the sudo password -> not good
So in visudo
add line
But login not work !!
I must restart in recovery mod and delete my script.
Thanks for support.
Frank
I take advantage of this platform since it is the OS that I use by cons against my problem is more general under Linux.
I want to make a Logon script for mount remote share from NAS. 1 script for all.
I can't use FSTAB, because the NAS HOME folder is not same for each computer user.
What I did and my idea:
I use this line
- Code:
sudo mount.cifs //NAS/home $LocalPathMountFolder -o credentials=/home/$USER/.$USER_cred
I create /home/$USER/.$USER_cred with user NAS credentials (user + pass)
When i start my script and give sudo password, it's work.
I have push my script in /etc/profile.d/mountnas.sh
- Code:
Chmod 644 /etc/profile.d/mountnas.sh
With "sudo mount.cifs" i need to give the sudo password -> not good
So in visudo
add line
- Code:
user ALL=(ALL:ALL) NOPASSWD:/etc/profile.d/mountnas.sh
But login not work !!
I must restart in recovery mod and delete my script.
Thanks for support.
Frank