1834634 Members
3061 Online
110069 Solutions
New Discussion

Restricted Telnet

 
Anshumali
Esteemed Contributor

Restricted Telnet

Okay....i am stuck again.... :)

What i need is:
Create a user with shell accesss and should be able to do cd within his home directory only. Other words chrooting the home directory.
I have followed sugegstions in threads but somehow no luck.
Password file looks like:
anstest:*:105:20:Anshu Test Shell,,,:/home/anstest/./:/bin/sh

And the /etc/profile contains:

if [ "$LOGNAME" = anstest ]
then
chroot /home/anstest
fi

what is missing here? Anything else to configure.

OS 11.11

Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
11 REPLIES 11
Steven Schweda
Honored Contributor

Re: Restricted Telnet

> what is missing here?

An explanation of what, exactly, "no luck"
means. What happens? What doesn't work?
Ralf Seefeldt
Valued Contributor

Re: Restricted Telnet

Hello Anshumali,

if you use an * in /etc/passwd, unles you don't use a secure system, you disable login for that user.

man passwd

What exactly are your problems? Can you log in? Do you have to many or to little permissions?

Bye
Ralf
Ivan Ferreira
Honored Contributor

Re: Restricted Telnet

I'm not sure if you can do this with telnet, with SSH is possible and you should by now, use SSH.

The chroot command requieres:

1- An chroot environment created
2- A command to execute
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
spex
Honored Contributor

Re: Restricted Telnet

Perhaps rsh (Restricted Shell) would be a better fit for your needs. See "rsh Restrictions" in the sh-posix(1) man for more information.
Anshumali
Esteemed Contributor

Re: Restricted Telnet

Yes Its a trusted System, that why password field is *
What doesnt work?:
Logging the same anstest user, user can navigate to all the file system. it doesnt show as homedir as chrooted directory.

rsh:
Yes...i gave it a try but it doesnt provide access to cd command. Is there anyway to provide access to cd command in rsh? User should be able to traverse down from his home directory, but not upwards...thats the reason i went for chroot method.

Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Anshumali
Esteemed Contributor

Re: Restricted Telnet

Ivan,

Any pointers/threads how to get this done with SSH. I would surely give it a try. Ofcourse, auditors will be happy as well. ;)

Thanks,
Anshu
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
HGN
Honored Contributor

Re: Restricted Telnet

Hi

Ours is also a trusted system but we have implemented with ssh (chroot'd env) amd know for sure it works.

Rgds

HGN
Anshumali
Esteemed Contributor

Re: Restricted Telnet

HGN,

Is there any doc to configure chrooted env with SSH or the above settings are similar with ur env and works well when SSH is installed. Any specific config in SSH?
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Anshumali
Esteemed Contributor

Re: Restricted Telnet

i got
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1122269
will try it out....still appreciate if anyone can shed light on the original question :)
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
rariasn
Honored Contributor

Re: Restricted Telnet

Hi Anshumali,

/opt/ssh/README_chroot.html

rgs,
Anshumali
Esteemed Contributor

Re: Restricted Telnet

Syntax issue
/opt/ssh/README_chroot.html helped and the responses above
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!