Operating System - HP-UX
1751879 Members
5339 Online
108782 Solutions
New Discussion юеВ

vg commands as non-root user

 
Riccardo Favaro
Contributor

vg commands as non-root user

Hi all,
is there any way to run vgimport, vgchgid, vgchange and mount commands as a non-root user?
Any, I say, ANY suggestion will be precious!!!!

Thanks a lot
Riccardo

rfavaro@iss.net
9 REPLIES 9
Sachin Patel
Honored Contributor

Re: vg commands as non-root user

Only one way, use sudo, super or other third party software and give access to user to run specific command with uid 0 i.e root.

For example
You can assign user sachin a permission to run a command vgchange with root access. sachin can run only that command with root access.

But overall not a good idea to give a user permission to run that kind of command. Why are we have system admin people?

Sachin
Is photography a hobby or another way to spend $
Santosh Nair_1
Honored Contributor

Re: vg commands as non-root user

Unforunately, you can not run any of these programs without root privledges. You can however, use something like sudo (available at the HP porting site: http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.2b1 )to allow users to run these commands as root.

-Santosh
Life is what's happening while you're busy making other plans
Uday_S_Ankolekar
Honored Contributor

Re: vg commands as non-root user

Hi,

I guess you can't do this without root privilege.
you can get some utilities like 'sudo' to run
some of these command but not a good idea.

-USA..
Good Luck..
A. Clay Stephenson
Acclaimed Contributor

Re: vg commands as non-root user

Hi Riccardo:

You can very easily do this with sudo or by creating a small C setuid program which in turns does system calls. HOWEVER, all of these utilities are only allowed to be run by root for a reason; I don't think that you want ordinary users to be able to destroy your systems.

For your question, it appears that this is a backup issue - the better answer is to write a small setuid program that execute these steps as part of a backup pre-exec script.

Clay
If it ain't broke, I can fix that.
MANOJ SRIVASTAVA
Honored Contributor

Re: vg commands as non-root user

Hi Ricaardo

Since these commands use files which are owned by root , u cannot run these command using a non root id. So you can either use sudo , or su to root , or create a user with root previlages and run the commands.

Manoj Srivastava
Deshpande Prashant
Honored Contributor

Re: vg commands as non-root user

Riccardo
The easy way to achieve this will be to make use of utility "sudo".
If you describe your situation, may be some one will have more ways to do it.

Thanks.
Prashant.
Take it as it comes.
harry d brown jr
Honored Contributor

Re: vg commands as non-root user

I wouldn't suggest doing anything like that. They are for root user for a reason. Pretending to be root user, without accepting the responsibility of being the admin is dangerous. It'd be like suggesting President Bush to take a personal vacation tomorrow in Kabul.
Live Free or Die
Sachin Patel
Honored Contributor

Re: vg commands as non-root user

Harry Nice one....
While Bush goes on vacation, I can pretend to be President!!! hooooo.

Sachin
Is photography a hobby or another way to spend $
Wodisch
Honored Contributor

Re: vg commands as non-root user

Hello,

you could put those commands into a shell-script and make that executable through SAM for that user...
Start "sam -r" and add that script (running as "root") to SAM's menu. Then give that user the permission for ONLY that menu.

HTH,
Wodisch