Error "unknown user" with chroot patch and scp

From: Toni comerma (tcomerma@eresmas.com)
Date: 05/13/02


From: tcomerma@eresmas.com (Toni comerma)
Date: 13 May 2002 03:10:08 -0700

I tried the chroot patch on a Sun Solaris 8 system using openssl
3.1p1. It seems to work ok for ssh and sftp, but scp refuses to work,
giving the following message

unknown user 1002

/etc/passwd, /etc/group, /etc/nsswitch.conf, /etc/pam.conf, and even
/etc/shadow have been copied to the new root. User 1002 appears on
/etc/passwd as

toni:x:1002:102:Toni:/home:/bin/sh

I found the source at scp.c

        if ((pwd = getpwuid(userid = getuid())) == NULL)
                fatal("unknown user %d", (int) userid);

but I don't understand what can cause it.

Thanks in advance for any help.

Toni Comerma