Visit Our UNIX and Linux User Community


Mounting a standard user, windows share at login


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Mounting a standard user, windows share at login
# 1  
Old 12-01-2011
Mounting a standard user, windows share at login

I know how to mount my share via /etc/fstab automatically when the system boots but since I do not have root permission to access the /etc/fstab nor do I think that the system admin wants me to add an entry in /etc/fstab all together. So what file could I add my mount entry in?

Code:
mount -t cifs //ntserver/download -o username=vivek,password=myPassword /mnt/ntserver

.profile ??
# 2  
Old 12-01-2011
Hi,

look at the section 'The non-superuser mounts.' of mount man pages.

see ya
fra
This User Gave Thanks to frappa For This Post:
# 3  
Old 12-01-2011
In short, even user-mode mounting must be prepared in advance by root.

If you do end up putting it in /etc/fstab, be sure to give it the 'noauto' option, otherwise it may try to mount it on boot and fail to boot if it can't.
This User Gave Thanks to Corona688 For This Post:
# 4  
Old 12-01-2011
Good point. I know that if there is a gui and through Gnome -- Nautilus, it will automatically mount the share if chosen. I scratch my head at that in how can you allow an automount using the GUI but not through the CLI for system who boot at run levels with GUI's.
# 5  
Old 12-01-2011
Quote:
Originally Posted by metallica1973
Good point. I know that if there is a gui and through Gnome -- Nautilus, it will automatically mount the share if chosen. I scratch my head at that in how can you allow an automount using the GUI but not through the CLI for system who boot at run levels with GUI's.
Gnome gets away with it by nothing less than the complete subversion of PAM -- not just for mounting, but for a variety of things. It silently (and invisibly) upgrades access groups for graphical logins to give them write-permissions on audio devices, for instance. It needs hooks all over the place to do this. I'm sure there'll be a royal mess-up someday with security holes of Microsoft proportions.

If they wanted you to mount something or edit fstab, they should have given you root.

Last edited by Corona688; 12-01-2011 at 04:57 PM..
# 6  
Old 12-01-2011
Though this still requires root access ,this shows promise, AutoFS:

https://help.ubuntu.com/community/Autofs


http://wiki.centos.org/TipsAndTricks... - CentOS Wiki

AutoFS appears to be more a more efficient way of conserving bandwidth as well but I have never used it before

---------- Post updated at 04:16 PM ---------- Previous update was at 04:04 PM ----------

Thanks for the replies,

Was wondering about using the noauto option. If this is used will it still mount the drive after the boot automatically, or would i still have to mount the share after login manually?

Last edited by metallica1973; 12-01-2011 at 05:10 PM..
# 7  
Old 12-01-2011
You need to have CAP_SYS_ADMIN privileges to mount something, period, end of story, no exceptions.

The 'user' option in /etc/fstab works because /bin/mount is a setuid executable, always running as root. It must check whether you're allowed to mount anything by itself, and checks against /etc/fstab, a file only modifiable by root.

gnome gets away with it by installing hooks into PAM to give it lots of permissions you're probably unaware of. It definitely needed root to install all those.

autofs gets away with it by running a system daemon with root permissions that mounts things for you. Naturally to install it you need root.

If you find any way to mount a filesystem without needing root's authority to configure or install anything, that is a bug and should be fixed.

---------- Post updated at 03:31 PM ---------- Previous update was at 03:29 PM ----------

Quote:
Originally Posted by metallica1973
Was wondering about using the noauto option. If this is used will it still mount the drive after the boot automatically, or would i still have to mount the share after login manually?
It won't mount automatically, no.

It won't hang the system if it doesn't work, either.

I'd put @reboot /bin/mount /path/to/mountpoint in your user crontab instead, or perhaps /bin/mount /path/to/mountpoint in /etc/local.start instead if I wanted it to not depend on any user. It won't halt the boot process if mount fails in those places.
This User Gave Thanks to Corona688 For This Post:
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #459
Difficulty: Medium
NTP uses an epoch of January 1, 1970.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Mounting a samba share

Hi, I need to mount a directory from a Windows server to a CentOS box. The Windows server used is Windows Server 2003, and the path to the directory that I want to mount on CentOS is C:\Tomcat6\webapps\NASApp\logs. I am not sure of the correct way to mount this on CentOS, as most of the... (2 Replies)
Discussion started by: anaigini45
2 Replies

2. UNIX for Beginners Questions & Answers

Mounting Windows Share to Linux Server

Hi Folks - I need to mount a Windows Share to a Linux server. What is the best/easiest way to do this? Is this 'how-to' guide accurate: How to Share Files Between Windows and Linux Or is there a better method you could share? Thanks! (8 Replies)
Discussion started by: SIMMS7400
8 Replies

3. UNIX for Dummies Questions & Answers

[Solved] error while mounting windows share on linux

Hi whan i am trying to mount a windows share on linux i received the following error can some one help me with thsi # mount -t cifs \\\\servername\testdata -o username=xw27,password=*es*feed /test Mounting the DFS root for a particular server not implemented yet No ip address specified... (5 Replies)
Discussion started by: robo
5 Replies

4. HP-UX

user can't write on cifs share but OK with Windows Explorer

Share ServerA ==== The Samba server is running on Samba version 3.0.22 based HP CIFS Server A.02.03.04 /opt/cifsclient/sbin/cifsclientd version: HP CIFS Client - Version A.02.02.02 smb file: My previous casw was thew user wasn't able to write to the share from Windows... (1 Reply)
Discussion started by: lamoul
1 Replies

5. Shell Programming and Scripting

Script to copy User home folders to mounted windows share

First of all, let me state that I am a windows admin. I have a windows share mounted to /mnt/server I need a script that will either login as sudo or perform commands with sudo rights. I need the script to copy all of the users /home folders to the mounted windows share. Now If I can... (7 Replies)
Discussion started by: EricM
7 Replies

6. Solaris

mounting windows share folder

please help me,,i need step to mount windows share folder,,i try samba and nfs and it didnt work (in my linux server the command is fine),,can somenone give me an example for this to be done? (0 Replies)
Discussion started by: Cellscript
0 Replies

7. IP Networking

Problem Mounting NFS share

I have one machine "The server" ip: 192.168.1.1, it runs ubu 8.04(LTS) and - I have a folder (/shareme) that I want to share with other linux machines on my LAN. - The server runs NFS server and common and portmap and so do the other machines on my LAN. - The server has the export file with the... (2 Replies)
Discussion started by: fcron
2 Replies

8. UNIX for Advanced & Expert Users

Help mounting Windows share in UNIX

We recently upgraded one of our engineering servers, and now the lone UNIX box that houses older CAD files can not connect to it. I have tried every variation of mount I can find, but to no avail. Help is appreciated. Here are the specs: Server: Windows 2003 x64 with Unix Services for Windows... (8 Replies)
Discussion started by: shatterstorm
8 Replies

9. Solaris

Mounting CIFS share

Is it possible to mount a samba share on a solaris system? I know this is possible with Linux using a fstype of smbfs. I am trying to aviod having to share the same directories via cifs and nfs on a solaris box to windows and solaris clients. (3 Replies)
Discussion started by: mhm4
3 Replies

10. Windows & DOS: Issues & Discussions

Mounting a windows share on AIX

Hi, How can I mount a Windows share (over samba) on an AIX machine? I know there is a utility called smbmount on Linux, but alas, I cannot find out how to the same thing on AIX. anyone have any ideas? thanks! (3 Replies)
Discussion started by: szahir1
3 Replies

Featured Tech Videos