Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* chroot and login
@ 1998-03-11 20:19 Gavin Woodhatch
  1998-03-12 15:03 ` mike
  0 siblings, 1 reply; 2+ messages in thread
From: Gavin Woodhatch @ 1998-03-11 20:19 UTC (permalink / raw)
  To: axp-list

Hi Guys

I know this is not quite Alpha specific .. but i do want it working on
my AS500 :)

I am Trying to do the following  .. when you login as a specific user
I would like to have a chroot shell up .. so my customers cant wrek to
mutch havok  ..

The command 'chroot /usr/local/telnetroot' works fine.

If i add '/usr/bin/chroot /usr/local/telnetroot' to  /etc/passwd (as
shell)
It does not work ,even after adding '/usr/bin/chroot' to /etc/shells  ..
doesnt help

I have come to the conclusion that Login can't handel any  parameters ?

So i have tried my (very bad ) C knowlege  :

#include <unistd.h>
    void main(int argc, char * argv[]) {
    chroot("/usr/local/telnetlogin");
    execl("/bin/bash",0);
}

compiled with gcc .  no errors ..

but when executing the binary  : Segmentation Fault

Using  :
#include <unistd.h>
    void main(int argc, char * argv[]) {
    chroot("/usr/local/telnetlogin");
    execl("/bin/bash","/bin/bash",0);
}

gcc no errors again  ..

this time it works .... i get a new shell .. but the chroot part does
not work ..
it returns a value of '-1' thats means an error acurred .. but i dont
know what..


Any ideas  ?


Gavin Woodhatch




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: chroot and login
  1998-03-11 20:19 chroot and login Gavin Woodhatch
@ 1998-03-12 15:03 ` mike
  0 siblings, 0 replies; 2+ messages in thread
From: mike @ 1998-03-12 15:03 UTC (permalink / raw)
  To: Gavin Woodhatch; +Cc: axp-list



Have you made a replica of your /bin and /usr/bin directories in the new
root location? If you dont you wont beable to do much.

On Wed, 11 Mar 1998, Gavin Woodhatch wrote:

> Hi Guys
> 
> I know this is not quite Alpha specific .. but i do want it working on
> my AS500 :)
> 
> I am Trying to do the following  .. when you login as a specific user
> I would like to have a chroot shell up .. so my customers cant wrek to
> mutch havok  ..
> 
> The command 'chroot /usr/local/telnetroot' works fine.
> 
> If i add '/usr/bin/chroot /usr/local/telnetroot' to  /etc/passwd (as
> shell)
> It does not work ,even after adding '/usr/bin/chroot' to /etc/shells  ..
> doesnt help
> 
> I have come to the conclusion that Login can't handel any  parameters ?
> 
> So i have tried my (very bad ) C knowlege  :
> 
> #include <unistd.h>
>     void main(int argc, char * argv[]) {
>     chroot("/usr/local/telnetlogin");
>     execl("/bin/bash",0);
> }
> 
> compiled with gcc .  no errors ..
> 
> but when executing the binary  : Segmentation Fault
> 
> Using  :
> #include <unistd.h>
>     void main(int argc, char * argv[]) {
>     chroot("/usr/local/telnetlogin");
>     execl("/bin/bash","/bin/bash",0);
> }
> 
> gcc no errors again  ..
> 
> this time it works .... i get a new shell .. but the chroot part does
> not work ..
> it returns a value of '-1' thats means an error acurred .. but i dont
> know what..
> 
> 
> Any ideas  ?
> 
> 
> Gavin Woodhatch
> 
> 
> 
> -- 
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-03-12 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-03-11 20:19 chroot and login Gavin Woodhatch
1998-03-12 15:03 ` mike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox