Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make user to run mksysb

Status
Not open for further replies.

call

Technical User
Oct 31, 2000
127
US
I need to make a user that can run a mksysb only
can someone tell me how?
thanks
 
In the user's profile, have the last line call mksysb with all/any options required.
Better still, have it call a script that allows the user to choose to run mksysb and also check the logged output/errors
Also, you should set trap to dissallow escaping to the command line - eg trap 'exit' 1 2 3 15

HTH

Dickie Bird (:)-)))
 
You could add it to the /etc/password as it's default shell

instead of :/bin/ksh

have it call :smit mksysb

This way, they can use the smit mksysb screens, but as soon as they exit, they will get logged off, and there is no escape problems from the profile executing.
 
You would also have to add /usr/bin/smitty mksysb to the /etc/shells file or the connection will be refused.
 
Actually, it's not needed in /etc/shells for a connection.

Just change the smit mksysb to /usr/bin/smitty mksysb
 
One question with regard to using smitty mksysb, can the user not not have access to shell escape (F9) as well? I guess this will give the user root privileges also.

regards.
 
Cant I just make a user who can run the smit mksysb?
 
Nathans, I tried it (pressing F9) and there wasn't much I could do. If I tried to cd to a directory or a pwd or an ls (anything requiring me to press Enter), I got put back to the mksysb screen. There may be some way a really smart user could stay in the shell, but I don't know what it is.

Call, it really is easy to set up a user like this. theycallmetim was right, you just have to put /usr/bin/smitty mksysb as the user's shell in /etc/passwd. And I think you are going to want to run smitty -- you can't be positive the user will always be in an Xwindow environment to run smit.
 
By putting smitty mksysb as your default shell in passwd, by pressing F9 you are escaping to your default shell, whenever you press Enter you will be redirected back into the smitty mksysb menu. If pressing any other key, (such as control characters Ctrl+Z), you will be disconnected. Smitty mksysb cannot interpret these commands.

call: As far as creating a user to execute just mksysb you have 2 examples here. I can't think of another way, although if you do not want the user to be able to break out of executing their .profile, you could read in the users id from the login (in /etc/profile $LOGNAME) and execute the same scripts if that user logs in.

trap "" 1 2 3
readonly LOGNAME

 
I am really sorry, but why use smit? Why not just use a simple script like for example:

nohup /bin/mksysb -miX /dev/rmt0 > /tmp/mymksysb.log 2>&1 &

Create the user you want to do this mksysb and put it in his line of the /etc/passwd as the program that should be executed at login, ie. it is instead of /bin/ksh for new created user. If that is not enough and you want to have the user using other options for mksysb or whatever, put in a mini-menue with some "case" instructions.

I wouldn't use smit. Use a self written script and let it be executed, when the user logs in.

laters
zaxxon
 
Forgot to say you have to install the sudo package, that you can get at and use sudo, to call mksysb it as if you were root. Sorry, i was a bit too fast :)
Sudo is a very nice tool anyway, you will like it and might use it often i bet.
Use visudo to edit the sudo configuration and tell it, that your backup user may use mksysb on that host.
The script would look like that:

nohup sudo /bin/mksysb # and so on


laters
zaxxon
 
Thanks to everybody who responded to my question.
It was easy I was not editing the etc/passwd file right.
I now have it again thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top