- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sudo privelege for /dev/kmem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
11-12-2012 09:06 AM
11-12-2012 09:06 AM
Hi gurus,
I need to give sudo priveleges to one user iris for the below commands
1) echo itick_per_usec/D | adb -k /stand/vmunix /dev/kmem | tail -1
2) echo 'memory_installed_in_machine/D' | adb -k /stand/vmunix /dev/mem | tail -1
for the first command, i have put as below in sudoers file
iris ALL=(root) NOPASSWD:/usr/bin/adb -k /stand/vmunix /dev/kmem,/usr/bin/echo itick_per_usec/D
but while executing, it is giving below error:-
$ sudo echo itick_per_usec/D | adb -k /stand/vmunix /dev/kmem | tail -1
cannot open `/dev/kmem', errno = 13, Permission denied
I tried by giving just /usr/bin/adb in sudoers file, but it also did not work and showing the below error
$ sudo echo itick_per_usec/D | adb -k /stand/vmunix /dev/kmem | tail -1
Password: cannot open `/dev/kmem', errno = 13, Permission denied
Sorry, user iris is not allowed to execute '/usr/bin/echo itick_per_usec/D' as root on ebzdbp10.
$
The permissions of the files are as below:-
$ ll /stand/vmunix
-rwxr-xr-x 1 root sys 26958832 May 31 2005 /stand/vmunix
$ ls -ld /dev/kmem
crw-r----- 1 bin sys 3 0x000001 Nov 15 2000 /dev/kmem
$
Please help with above both commands
Thanks
Vishu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2012 11:27 AM
11-12-2012 11:27 AM
Solution> $ sudo echo itick_per_usec/D | adb -k /stand/vmunix /dev/kmem | tail -1
This command will only run the first part (highlighted in red) with root privileges. You'll want to specify the command a bit differently:
echo itick_per_usec/D | sudo adb -k /stand/vmunix /dev/kmem | tail -1
You can remove the "echo" command from the sudoers file. "echo" only writes stuff to standard output; it will never need root access for anything.
(If you want to redirect the output of "echo" to something that requires root privileges, you won't need the privileges for the "echo" command, but for the shell that sets up the redirection before running the actual command.)