LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   permission problem!!! (https://www.linuxquestions.org/questions/linux-newbie-8/permission-problem-835256/)

john aka jondi 09-29-2010 02:23 PM

permission problem!!!
 
when i try to create a file or folder by standing as root and after that when i check its permission then the gid of root is always the value 500!!
for eg
i first logged in as root
and i created a file named "pq" in /
like this....
[root@server /]# touch pq
[root@server /]# ls -ld pq
drwxr-xr-x 2 root 500 4096 Sep 30 00:49 pq

why that gid is always 500 for me!!!

i have no idea to do anything with that..pls help!!

CincinnatiKid 09-29-2010 02:32 PM

Post the output of /etc/passwd

CincinnatiKid 09-29-2010 02:38 PM

Wait a second, maybe it is the "d" parameter. Try:

ls -l

I think the d is for a directory specifically.

John VV 09-29-2010 03:07 PM

Quote:

when i try to create a file or folder by standing as root
WHAT

what are you doing ??
loging into the gui as root ?
or using one of these two
" su " or " su -" in the terminal ?

if i had to bet ?? it is su WITHOUT the -

please post EXACTLY what you are doing to make that folder in /

gdejonge 09-29-2010 10:49 PM

The fact that touch will create a directory instead of a file make me suspect that something is wrong with the root filesystem.

Step 1 is to make sure your file system is ok.

First check on which partition your rootdir is mounted
Code:

root@orion:/# mount | grep on\ /\ type
/dev/sdb7 on / type ext3 (rw,relatime,errors=remount-ro)

Reboot your system from a liveCD en do a fsck of de root partition.
Code:

# fsck /dev/sdb7
If everything checks out okay, reboot your system in single user mode. Mostly indicated as recovery in the grub menu's.

Log in as root
Now check your root uid/gid with
Code:

root@orion:/# id
uid=0(root) gid=0(root) groups=0(root)

This will tell you what the defaults for your uid/gid are and which groups you are a member of.

After that we can take it further.

___________________
Gerrard

prayag_pjs 09-29-2010 11:32 PM

Plese give us the output of

Code:

cat /etc/passwfd |grep -i "root"
and

Code:

id
also try creating a file using cat or vi instead of touch and let us know the permissions


All times are GMT -5. The time now is 05:15 PM.