Hi Expert,
I am trying to change ownership of one file to another user that is exist in the system but getting operation not permitted error
what could be the correct way?
[root@pandora18 tochange]# ls -lh .Xauthority_ori
-rw------- 1 maxim atlas 2.8K Jul 27 17:18 .Xauthority_ori
[root@pandora18 tochange]# id -a
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
[root@pandora18 tochange]# id -a maxim
uid=47375(maxim) gid=54345(wisma) groups=54345(wisma)
[root@pandora18 tochange]# id -a tochange
uid=46764(tochange) gid=1000(atlas) groups=1000(atlas),30101(sign)
[root@pandora18 tochange]# chown tochange:atlas .Xauthority_ori
chown: changing ownership of `.Xauthority_ori': Operation not permitted
[root@pandora18 tochange]# ls -ld
drwxr-xr-x 41 tochange atlas 8192 Sep 7 18:06 .
cero
September 8, 2011, 3:29am
2
root should be able to change the ownership. Did you check the filesystem that holds that file? Is it nfs or read-only?
filer23:/vol/vol101/home14/tochange on /home/tochange type nfs (rw,tcp,rsize=32768,wsize=32768,timeo=600,retrans=2,intr,addr=10.10.10.1)
FS type nfs
Peasant
September 8, 2011, 4:00am
4
If you are using NFS filesystem, you will need to change it on host filer23 (the NFS server) or export with no root squash or similiar option.
If you don't have user/group on NFS server to which you want to change ownership, you can use uid:gid on NFS server as numbers not actual names.
How do I perform the following?
If you don't have user/group on NFS server to which you want to change ownership, you can use uid:gid on NFS server as numbers not actual names.
Peasant
September 8, 2011, 4:14am
6
You will go on client and see which GID and UID are used by user tochange and group atlas numericly.
Then you will connect to NFS server and position youself in that folder and run
chown uid:gid .Xauthority_ori where UID and GID are numbers on NFS client for that user / group.
For instance if tochange user has 101 UID and atlas group has 101 GID, you will issue on NFS server
chown 101:101 .Xauthority_ori
[root@svdcelk18 tochange]# chown 46764:1000 .Xauthority_ori
chown: changing ownership of `.Xauthority_ori': Operation not permitted
---------- Post updated at 12:28 AM ---------- Previous update was at 12:28 AM ----------
Still getting the same error
Peasant
September 8, 2011, 4:33am
8
You must log on to NFS server filer23 not the NFS client svdcelk8
Thank you. Now I understand. Unfortunately, I do not have the access to the filer.