Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
scp: unknown user
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tilman
n00b
n00b


Joined: 12 May 2007
Posts: 33

PostPosted: Sun Mar 31, 2013 11:55 pm    Post subject: scp: unknown user Reply with quote

Hi

Problem:
=======
~ $ scp
unknown user 1000

For whatever reason, the problem seems only be related to scp and the user 1000. As root, it seems to work:

# scp
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2


Unsuccessful attempt to reproduce the problem as user 1000:
============================================
~ $ cat user.c
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>


int main(int argc, char** argv)
{
struct passwd *pwd;
uid_t userid;
if ((pwd = getpwuid(userid = getuid())) == NULL)
printf("unknown user %u\n", (u_int) userid);
printf("user: %u\n",(u_int) userid);
}
~ $ ./user
user: 1000



Can anybody kindely assist ?
Thanks
Tilman
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Mon Apr 01, 2013 11:07 am    Post subject: Reply with quote

What are the permissions on /etc/passwd?
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
tilman
n00b
n00b


Joined: 12 May 2007
Posts: 33

PostPosted: Tue Apr 02, 2013 10:51 pm    Post subject: Reply with quote

I guess my gentoo installation became somehow inconsistent:

Code:

~ $ ls -lh /etc/passwd
-rw-r--r-- 1 root root 1.1K Oct 17  2011 /etc/passwd
~ $ which scp
/usr/local/bin/scp
~ $ ls -la /usr/local/bin/scp
-rwxr-xr-x 1 root root 678253 Oct 17  2011 /usr/local/bin/scp
 ~ $ ls -la /usr/bin/scp
-rwxr-xr-x 1 root root 54912 Apr  1 01:49 /usr/bin/scp
~ $ ldd /usr/local/bin/scp
        not a dynamic executable
~ $ ldd /usr/bin/scp
        linux-gate.so.1 =>  (0xb77eb000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb77a3000)
        libc.so.6 => /lib/libc.so.6 (0xb7649000)
        /lib/ld-linux.so.2 (0xb77cf000)

/usr/local/bin/scp does not work and terminates with the unknown user message. It seems not to be a permission issue. Removing /usr/local/bin/scp fixes the issue as now scp in /usr/bin runs.

Thanks for the hint regarding /etc/passwd.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum