View previous topic :: View next topic |
Author |
Message |
tilman n00b
Joined: 12 May 2007 Posts: 33
|
Posted: Sun Mar 31, 2013 11:55 pm Post subject: scp: unknown user |
|
|
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 |
|
|
tomk Bodhisattva
Joined: 23 Sep 2003 Posts: 7221 Location: Sat in front of my computer
|
Posted: Mon Apr 01, 2013 11:07 am Post subject: |
|
|
What are the permissions on /etc/passwd? _________________ Search | Read | Answer | Report | Strip |
|
Back to top |
|
|
tilman n00b
Joined: 12 May 2007 Posts: 33
|
Posted: Tue Apr 02, 2013 10:51 pm Post subject: |
|
|
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 |
|
|
|