1830504 Members
2388 Online
110006 Solutions
New Discussion

Restricted Login

 
MARCONI SPA
Occasional Advisor

Restricted Login

I have need to only qualify the telnet of a customer to the own HOME and below directory. They are not successful to find documentation with regard to, for which I wanted to know if the thing were feasible and eventually as. Thanks in advanced
Riccardo Bigoni
9 REPLIES 9
David Burgess
Esteemed Contributor

Re: Restricted Login

A restricted shell may help. It will keep the user in one directory.
Perhaps change the users group id to a uniq one that can't read anything, but their own files.

HTH,

Dave.
John Carr_2
Honored Contributor

Re: Restricted Login

steven Burgess_2
Honored Contributor

Re: Restricted Login

Hi

You need to give the user a restricted shell /usr/bin/rsh

via

useradd -m -s /usr/bin/rsh < user >

It gives

1. A user can't change dirs
2. Can't set env variables
3. Can't execute programs
4 I/O redirection is disabled

Have a look at man useradd for more info

Regards

Steve
take your time and think things through
Niraj Kumar Verma
Trusted Contributor

Re: Restricted Login

Hi,

I agree with steven

do use rsh as login shell.


-Niraj
Niraj.Verma@philips.com
MARCONI SPA
Occasional Advisor

Re: Restricted Login

Hi,

I dont'agree.
Is impossible to use rsh (or rksh) why this shell disable cd.
In my question i need do use $HOME and BELOW directory $HOME/1 $HOME/pppppdd etc.

Thanks.
Riccardo Bigoni
David Burgess
Esteemed Contributor

Re: Restricted Login

I don't think even chroot will help you.
I'm not sure it can be achieved.

Regards,

Dave.
Deepak Extross
Honored Contributor

Re: Restricted Login

I guess you'll have to rely on tight Unix permissions to do this - Create a new group and userid for this guy and make sure all other users/groups do not give access to "others" on any of their files/directories.
Of course your user will still be able to access places like /tmp which allow access to "others".
Geetha Alagappan
Regular Advisor

Re: Restricted Login

Bill Hassell
Honored Contributor

Re: Restricted Login

The only secure way to do this is to replace the shell with a menu program (note: program, not a shell script). If they are to be restricted to their own $HOME, they likely do not need all the shell and HP-UX commands, so let the menu handle their needs. Note tha programs like vi have an escape to a shell so make sure that if the menu program allows vi, that the variable SHELL=/usr/bin/false has been set in the environment.


Bill Hassell, sysadmin