SUDO-CHROOT - Linux

This is a discussion on SUDO-CHROOT - Linux ; I Use DEBIAN I use PAM for this and the Chroot.conf The problem is that when I log from windows pc to the linux wiht SSH I come in the chroot dir but when I want to use sudo it ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: SUDO-CHROOT

  1. SUDO-CHROOT



    I Use DEBIAN


    I use PAM for this and the Chroot.conf

    The problem is that when I log from windows pc to the linux wiht SSH I
    come in the chroot dir but when I want to use sudo it say:



    sudo: uid 1003 does not exist in the passwd file!

    what must I do ?
    The user who has sudo rights is in the passwd file.



    The users are in the passwd file and group.

    in the file sudoers:

    a user have:

    ALL = (ALL) ALL ( I want to change this if things work)

    here is a tree of the chroot invironment:


    ls -R /home/test

    /home/test:
    bin dev etc home lib tmp usr var

    /home/test/bin:
    bash df false gzip ls nano rmdir su true
    cat dircolors grep id mkdir pico sed tar vi
    cp du gunzip ln mv rm sh touch whoami

    /home/test/dev:
    null tty zero

    /home/test/etc:
    bash_completion group hosts init.d pam.d passwd shadow sudoers
    terminfo

    /home/test/etc/init.d:
    sudo

    /home/test/etc/pam.d:
    sudo

    /home/test/etc/terminfo:
    E a c d h l m p r s v w x

    /home/test/etc/terminfo/E:
    Eterm Eterm-color

    /home/test/etc/terminfo/a:
    ansi

    /home/test/etc/terminfo/c:
    cons25 cygwin

    /home/test/etc/terminfo/d:
    dumb

    /home/test/etc/terminfo/h:
    hurd

    /home/test/etc/terminfo/l:
    linux

    /home/test/etc/terminfo/m:
    mach mach-bold mach-color

    /home/test/etc/terminfo/p:
    pcansi

    /home/test/etc/terminfo/r:
    rxvt rxvt-basic rxvt-m

    /home/test/etc/terminfo/s:
    screen screen-bce screen-s screen-w sun

    /home/test/etc/terminfo/v:
    vt100 vt102 vt220 vt52

    /home/test/etc/terminfo/w:
    wsvt25 wsvt25m

    /home/test/etc/terminfo/x:
    xterm xterm-debian xterm-r5 xterm-vt220
    xterm-color xterm-mono xterm-r6 xterm-xfree86

    /home/test/home:
    pim test fake

    /home/test/home/pim:

    /home/test/home/test:
    testtext yes

    /home/test/home/fake:

    /home/test/lib:
    ld-linux.so.2 libc.so.6 libdl.so.2 libpam.so.0
    librt.so.1
    libacl.so.1 libcom_err.so.2 libext2fs.so.2 libpam_misc.so.0
    libattr.so.1 libcrypt.so.1 libncurses.so.5 libpthread.so.0

    /home/test/tmp:
    vi.0dmOuM vi.KNRPl9

    /home/test/usr:
    bin lib share

    /home/test/usr/bin:
    pico sudo

    /home/test/usr/lib:
    libgpm.so.1

    /home/test/usr/share:
    doc lintian terminfo

    /home/test/usr/share/doc:
    BUGS PORTING.gz TODO.gz changelog.Debian.gz examples
    HISTORY README TROUBLESHOOTING.gz changelog.gz
    OPTIONS RUNSON.gz UPGRADE copyright

    /home/test/usr/share/doc/examples:
    sudoers

    /home/test/usr/share/lintian:
    overrides

    /home/test/usr/share/lintian/overrides:
    sudo

    /home/test/usr/share/terminfo:
    E a c d h l m p r s v w x

    /home/test/usr/share/terminfo/E:
    Eterm Eterm-color

    /home/test/usr/share/terminfo/a:
    ansi

    /home/test/usr/share/terminfo/c:
    cons25 cygwin

    /home/test/usr/share/terminfo/d:
    dumb

    /home/test/usr/share/terminfo/h:
    hurd

    /home/test/usr/share/terminfo/l:
    linux

    /home/test/usr/share/terminfo/m:
    mach mach-bold mach-color

    /home/test/usr/share/terminfo/p:
    pcansi

    /home/test/usr/share/terminfo/r:
    rxvt rxvt-basic rxvt-m

    /home/test/usr/share/terminfo/s:
    screen screen-bce screen-s screen-w sun

    /home/test/usr/share/terminfo/v:
    vt100 vt102 vt220 vt52

    /home/test/usr/share/terminfo/w:
    wsvt25 wsvt25m

    /home/test/usr/share/terminfo/x:
    xterm xterm-debian xterm-r5 xterm-vt220
    xterm-color xterm-mono xterm-r6 xterm-xfree86

    /home/test/var:
    run tmp

    /home/test/var/run:
    sudo

    /home/test/var/run/sudo:
    pim test alex

    /home/test/var/run/sudo/pim:

    /home/test/var/run/sudo/test:

    /home/test/var/run/sudo/alex:

    /home/test/var/tmp:
    vi.recover

    /home/test/var/tmp/vi.recover:
    debian:/home/alex#


  2. Re: SUDO-CHROOT

    justme wrote:
    >
    > I Use DEBIAN
    >
    >
    > I use PAM for this and the Chroot.conf
    >
    > The problem is that when I log from windows pc to the linux wiht SSH I
    > come in the chroot dir but when I want to use sudo it say:
    >
    >
    >
    > sudo: uid 1003 does not exist in the passwd file!
    >
    > what must I do ?
    > The user who has sudo rights is in the passwd file.
    >
    >
    >
    > The users are in the passwd file and group.
    >
    > in the file sudoers:
    >
    > a user have:
    >
    > ALL = (ALL) ALL ( I want to change this if things work)
    >
    > here is a tree of the chroot invironment:
    >
    >
    > ls -R /home/test
    > ...


    >
    > /home/test/etc:
    > bash_completion group hosts init.d pam.d passwd shadow sudoers
    > terminfo
    > ...


    This is likely your problem. When you log in using the chroot
    environment, only the files under /home/test can be accessed.
    So sudo is not looking at /etc/passwd, it is looking at
    /home/test/etc/passwd. I bet uid 1003 isn't defined in that
    file!

    Don't copy the whole /etc/passwd file into /home/test/etc. Just
    add the few entries you actually need. The same goes for the
    group, shadow, and all other system configuration files: only
    the versions under /home/test will be used. It is up to you
    to maintain these versions, whenever the originals change.

    -Wayne

  3. Re: SUDO-CHROOT

    thank you BUT


    /home/test/etc:
    bash_completion group hosts init.d pam.d passwd shadow sudoers
    terminfo


    so you see I have the file and yes the user is insite de passwd to UID
    1003



    >This is likely your problem. When you log in using the chroot
    >environment, only the files under /home/test can be accessed.
    >So sudo is not looking at /etc/passwd, it is looking at
    >/home/test/etc/passwd. I bet uid 1003 isn't defined in that
    >file!
    >
    >Don't copy the whole /etc/passwd file into /home/test/etc. Just
    >add the few entries you actually need. The same goes for the
    >group, shadow, and all other system configuration files: only
    >the versions under /home/test will be used. It is up to you
    >to maintain these versions, whenever the originals change.
    >
    >-Wayne



+ Reply to Thread