HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sudo command to nfs mount a file system
Operating System - HP-UX
1832089
Members
2708
Online
110037
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2007 07:35 AM
07-23-2007 07:35 AM
I have created a Cmnd_Alias statement to nfs mount a file system (for the DBAs to run as needed), but visudo will not allow me to save the sudoers file. This is the Cmnd_Alias statement:
Cmnd_Alias NFS_MOUNT /usr/sbin/mount -F nfs -o rw hpservername:/backups /backups
This command works for me as root as a regular command. Is there something that sudo soes not like in this statement? Maybe the colon? Is the Cmnd_Alias location the correct place for this?
Thanks in advance!
Connie
Cmnd_Alias NFS_MOUNT /usr/sbin/mount -F nfs -o rw hpservername:/backups /backups
This command works for me as root as a regular command. Is there something that sudo soes not like in this statement? Maybe the colon? Is the Cmnd_Alias location the correct place for this?
Thanks in advance!
Connie
Independent by nature
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2007 08:02 AM
07-23-2007 08:02 AM
Solution
Your syntax is just a bit off. I think your statement should be:
Cmnd_Alias NFS_MOUNT=/usr/sbin/mount -F nfs -o rw hpservername:/backups /backups
The other thing I can think of that would make this slightly easier to create a small script containing the mount command:
# cat /usr/local/bin/dba-nfs-mount
/usr/sbin/mount -F nfs -o rw hpservername:/backups /backups
Set the permissions on the script to 500 (r-w------) and make root the owner.
Then you can just add:
CMND_ALIAS NFS_MOUNT=/usr/local/bin/dba-nfs-mount
to sudo.
Now your dba's just have to run:
$ sudo /usr/local/bin/dba-nfs-mount
rather than typing out the long mount string.
Cmnd_Alias NFS_MOUNT=/usr/sbin/mount -F nfs -o rw hpservername:/backups /backups
The other thing I can think of that would make this slightly easier to create a small script containing the mount command:
# cat /usr/local/bin/dba-nfs-mount
/usr/sbin/mount -F nfs -o rw hpservername:/backups /backups
Set the permissions on the script to 500 (r-w------) and make root the owner.
Then you can just add:
CMND_ALIAS NFS_MOUNT=/usr/local/bin/dba-nfs-mount
to sudo.
Now your dba's just have to run:
$ sudo /usr/local/bin/dba-nfs-mount
rather than typing out the long mount string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2007 08:13 AM
07-23-2007 08:13 AM
Re: sudo command to nfs mount a file system
Patrick - That sounds good. I'll try it! Thanks so much!
Independent by nature
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2007 08:17 AM
07-23-2007 08:17 AM
Re: sudo command to nfs mount a file system
It works.
Independent by nature
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP