1845978 Members
3381 Online
110251 Solutions
New Discussion

Login Shell

 
SOLVED
Go to solution
Gamaliel
Frequent Advisor

Login Shell

Hi Again,

I'm trying to create a new user with the only atribute to execute a menu shell, so I open sam and at Start-Up Program I put the path to the executable script but i wasn't able to set it. At older server i can proceed like this. Somebody?
6 REPLIES 6
Patrick Wallek
Honored Contributor

Re: Login Shell

What was the error you got? What did it do?

If all else fails you should be able to edit the /etc/passwd file and set the users default shell the what you need it to be.

Just be sure that the user has access to run that particular script/program.
Dave La Mar
Honored Contributor

Re: Login Shell

Joaquin -
We'll routinely put a menu call in the individual's .profile with an exit following.
Thus they have a choice of going into the menu and upon exiting the menu they are logged out.
Of course you will have to trap for cntrl-c, etc.

Best of luck.

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Bill Hassell
Honored Contributor
Solution

Re: Login Shell

It's a lot easier than you described. Simply run the chsh command to specify the menu script as the shell rather than /usr/bin/sh. Make sure you use the full path for the script, that the user can run the script (not in a restricted directory) and that the menu script has the first line:

#!/usr/bin/sh

(or whatever shell interpreter you are using). The #! line should be in 100% of all your shell scripts along with replacing (never appending) PATH with the necessary paths, something like this:

export PATH=/usr/bin

And to prevent potential problems, always use set -u to halt/exit on spelling errors.


Bill Hassell, sysadmin
Gamaliel
Frequent Advisor

Re: Login Shell

Pat,

The message is /path/menu is not a valid shell, i edit the passwd file and when connecting get the msg "no shell" ... I'll try the first line cmd.
Rodney Hills
Honored Contributor

Re: Login Shell

Add an entry into /etc/shells of the script you are running. This file contains the list of allowed shells for user login.

HTH

-- Rod Hills
There be dragons...
Gamaliel
Frequent Advisor

Re: Login Shell

Bill,

I did what 'u suggest and everything works fine!

Thk 'u all!