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
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.
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.
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.
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.
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:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.