DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-05-21 14:17:41

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

OpenSSH Warning

I recently install fun_plug 0.5 with Open SSH. All went well except for one little thing. When using Putty to log on the DNS323 with a User account two warnings are displayed. Logging on to the NAS as root yields a clean logon, no errors or warning raised.

Text from the user logon screen follows;

     Using username "Xxxxxxxx".
     Xxxxxxxx@DNSxxxxxxxxx's password:
     id: unknown group name: 502
     sh: 0: unknown operand


The warning I refer to are shown in bold. How do I correct these id: and sh: warnings?

I found the following in the Wiki.

********** Quote **********
SSH sessions will start into the shell configured for the user in /etc/passwd. This defaults to the firmware's busybox shell /bin/sh (enter 5784468 to get a shell prompt).

The funplug includes tools to automatically change /etc/passwd and /etc/shadow:

start/passwd.sh can replace /bin/sh with /ffp/bin/sh for all users at startup.
start/pwconv.sh will add missing users to /etc/shadow
start/shells.sh will add /ffp/bin/sh and /ffp/bin/bash to /etc/shells
********** End Quote **********

Does it relate to the warnings I see when logging on as a user? If so, what steps should I be taking?

With Appreciation

Bob Blackwell
Pickering, ON

Last edited by rcblackwell (2008-05-21 14:18:25)


Bob Blackwell
Pickering, ON

Offline

 

#2 2008-05-21 15:56:26

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: OpenSSH Warning

rcblackwell wrote:

Text from the user logon screen follows;

     Using username "Xxxxxxxx".
     Xxxxxxxx@DNSxxxxxxxxx's password:
     id: unknown group name: 502
     sh: 0: unknown operand


The warning I refer to are shown in bold. How do I correct these id: and sh: warnings?

When you login, /ffp/etc/profile is evaluated. That file checks if you're 'root', and your message seems to result from that check:

Code:

if [ $(id -u) -eq 0 ]; then
    PATH=/ffp/sbin:/ffp/bin:/usr/sbin:/sbin:/usr/bin:/bin
...

I managed to reproduce the error messages, but only after damaging and breaking consistency of user and group files. I suspect that your /etc/group file is missing group 502. Although I don't know what broke your files, it shouldn't be hard to fix.

Before making any changes, verify that this is really the problem. As root, run the following commands (# lines) and compare the output:

Code:

# pwck -r
...
user xxx: no group 502
...

# /bin/id -u xxx
id: unknown gid 502

# grep 502 /etc/group
  (no output)

Every user must have an existing primary group. I assume it's 502 for your user (gid=YYY shows the user's primary group):

Code:

# id xxx
uid=...(xxx) gid=502 groups=502

For some more background, you might want to read the chapter on user management here: http://www.tldp.org/LDP/sag/html/managing-users.html (It's not very good, but I don't know better docs)

To fix your problem, we can either create the missing group:

Code:

# groupadd -g 502 users

or change the primary group of your user to some existing group. Chose a group (that exists in /etc/group) and do "usermod -g newgroup xxxx".

Retry login. If the message disappeared, store your changes to flash:

Code:

# store-passwd.sh

Offline

 

#3 2008-05-21 23:03:29

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: OpenSSH Warning

fonz wrote:

To fix your problem, we can either create the missing group:

fonz

That worked like a charm.

Very much appreciated.

Bob Blackwell


Bob Blackwell
Pickering, ON

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB