Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am facing the below problem in linux kernel 2.6.18-7.1

  1. I created user "BBC" using adduser -D after this /etc/passwd contains "BBC:x:1010:1010:Linux User,,,:/home/BBC:/bin/sh"

  2. I created group "BBCGROUP" using addgroup BBCGROUP

  3. added the user "BBC" to the group "BBCGROUP" using addgroup BBC BBCGROUP after this etc/group contains

    BBC:x:1010:

    BBCGROUP:x:9:BBC

  4. then created the directory mkdir /usr1 [ as root ]

  5. I created file /usr1/test.txt by using echo "hello" > /usr1/test.txt

  6. ls -l /usr1 gives "-rwxrwx--x 1 root root 5 Sep 5 14:01 test.txt"

  7. chmod -R 771 /usr1

  8. chown -R :BBCGROUP /usr1.

After this I expect, user "BBC" able to read/write/execute files under /usr1 .

Now "ls -l /usr1 " gives -rwxrwx--x 1 root BBCGROUP 5 Sep 5 14:03 test.txt 9)I changed the user to "BBC" by "su -s /bin/sh BBC" 10) id command shows uid=1010(BBC) gid=1010(BBC) 11) cd /usr1 12) I tried to modify the file echo "HELLO1" > test.txt or touch test.txt I getting error as "sh: can't create /usr1/test.txt: Permission denied" for user BBC.

This is the basic problem, I am facing in embedded system, any solution for this. Any configuration need to be changed? Same thing working fine in desktop linux. Any info please to solve this.

share|improve this question

migrated from stackoverflow.com Sep 6 '11 at 13:29

This question came from our site for professional and enthusiast programmers.

    
You really need to format that before I try to read it anymore. –  Jeff Ferland Sep 6 '11 at 11:25
    
Any particular reason your not using the tools for this, even if your just running a script post install? For example how are you ensuring shaddow is correctly setup? –  stsquad Sep 6 '11 at 11:44
    
Out of curiosity, does the man page for passwd have the following restriction on the username field? "It should not contain capital letters." –  Xenoactive Sep 6 '11 at 17:38

1 Answer 1

You may try to use the newgrp BBCGROUP command before entering the directory.

Alternatively, you may want to change the default group for this user to BBCGROUP instead of BBC. Maybe the addgroup utility can do it (I have some other flavour of utilities here, so I am not sure), or you can manually change the second :1010: to :9: in the /etc/passwd file (carefully!).

And by the way, this question seems to be more appropriate to http://superuser.com/ or (better:) http://unix.stackexchange.com/ I suppose.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.