Operating System - HP-UX
1837650 Members
2896 Online
110117 Solutions
New Discussion

Re: Problem to configure CHROOT for Telnet

 
Wilder Mellotto
Frequent Advisor

Problem to configure CHROOT for Telnet

Hi, I need configure chroot in my hpux 11.00 server.

I read some posts in ITRC but I can't find a post to help me. A lot of posts have tricks to do chroot with FTP, but I need this configuration for telnet.

I have an user "desenv". I want to make login with "desenv" and have the "/desenv" directory as the root "/" for this user.

I can't found anything to help. Please, if someone can help me, I'll appreciate.

Thanks.
4 REPLIES 4
Peter Godron
Honored Contributor

Re: Problem to configure CHROOT for Telnet

Hi,
you may have missed this one:
"Limiting where telnet users can go"
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=26166

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
Court Campbell
Honored Contributor

Re: Problem to configure CHROOT for Telnet

My first thought would be to make sure that the user has all the things he/she would need under the home directory, ie, /bin/sh, /bin/anything else. I cannot tell you all that you will have to put in the chroot directory. Then I would add a line in /etc/profile that tests for the username desenv and chroot's to the directory /desenv. That's just a thought; I don't know if it will work that easily.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Wilder Mellotto
Frequent Advisor

Re: Problem to configure CHROOT for Telnet

Thanks for the quick reply, but I already read that post Peter, and I don't know how to do this. I realy don't make any ideas how chroot works, what command I need (sintax).

In fact I need a step-by-step.

My /etc/passwd:
desenv:DOGo6ivCKOzNY:101:20::/desenv/./:/sbin/sh

/desenv/.profile (this is the file, but I don't know what I need edit here)

chroot /desenv /

I realy need help, I am tottaly lost.
Court Campbell
Honored Contributor

Re: Problem to configure CHROOT for Telnet

first

mkdir -p /desenv/bin
cp /bin/sh /desenv/bin

copy whatever else the user would need under desenv. You have to realize that / now starts from /desenv. If you do not have a shell, etc, copied under /desenv the user is not going to be able to do anything.

Then you could try this in /etc/profile:

if [ "$LOGNAME" = desenv ]
then
chroot /desenv
fi


"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"