login

Tito farmatito at tiscali.it
Tue Jan 11 14:17:25 UTC 2011


On Saturday 08 January 2011 18:13:45 David Henderson wrote:
> I'm back with yet another question - thanks to all of those who've been 
> patient and provided help thus far.  I'm working on the actual login 
> aspect of the distro at this point, but have been running into problems 
> using some of the applets provided in busybox.  I'm sure they're user 
> error, but here we go...
> 
> I initially tried to copy the /etc/passwd, shadow, group, and gshadow 
> files from my working Kubuntu distro to busybox (after recompiling 
> without pam support).  I figured it wouldn't work, and it failed as I 
> suspected.  What I decided to do, at this point, was get to a prompt and 
> create those files using the applets from busybox so there'd be no 
> issues.  Below is what I tried to do and the errors that were given:
> 
> # cd /etc
> # rm group gshadow passwd shadow
> # touch group gshadow passwd shadow
> # addgroup -g 0 root
> # addgroup users
> # cat group
> root:x:0:
> users:x:1000:
> # adduser -h /root -s /bin/bash -G root -u 0 root
> adduser: unknown group root
> # adduser -h /home/dave -s /bin/bash -G users dave
> adduser: unknown group users
> 
> I read online that busybox may not work well with GID's and UID's 
> outside of the range specified in it's configuration (mine was set to 
> start at 100 and end at 999 by default).  So I was expecting issues 
> adding and working with the root account as it's UID and GID are 0.  
> However, busybox added the "users" group as 1000 (outside the range 
> specified in its config) and still gives errors when trying to use it.  
> Any ideas?
> 
> Dave

Hi,

ln -s busybox addgroup
ln -s busybox adduser
touch group gshadow passwd shadow
./addgroup -g 0 root
cat group gshadow
root:x:0:
root:!::
./adduser -h /root -s /bin/bash -D -G root -u 0 root
cat group gshadow passwd gshadow
root:x:0:root
root:!::root
root:x:0:0:Linux User,,,:/root:/bin/bash
root:!::root
 ./addgroup users
cat group gshadow
root:x:0:root
users:x:1000:
root:!::root
users:!::
./adduser -h /home/dave -s /bin/bash -G users -D  dave
cat group gshadow passwd gshadow
root:x:0:root
users:x:1000:dave
root:!::root
users:!::dave
root:x:0:0:Linux User,,,:/root:/bin/bash
dave:x:1000:1000:Linux User,,,:/home/dave:/bin/bash
root:!::root
users:!::dave

This seems to work locally for me. You could also try:

echo "root:x:0:0:root:/root:/bin/bash" > /etc/passwd
echo "root::14389:0:99999:7:::" > /etc/shadow
echo "root:x:0:" > /etc/group
echo "root:!::" > /etc/gshadow
chmod 644 /etc/passwd
chmod 644 /etc/group
chmod 600 /etc/shadow
chmod 600 /etc/gshadow
passwd root
addgroup users
adduser  -h /home/dave -s /bin/bash dave
addgroup dave users



Ciao,
Tito


More information about the busybox mailing list