LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2012, 07:18 AM   #1
cdhar
Member
 
Registered: Jul 2012
Posts: 41

Rep: Reputation: Disabled
chown: changing ownership of dir: Operation not permitted


Hi,

I have created the following folder under home/cdhar/
mkdir -p /u01/app/oracle/product/11.2.0/db_1

Now I need to change owner of the folder, but when I give the following command

[root@hdk01ytt cdhar]# chown -R gbuora:gbuinst u01
chown: changing ownership of `u01/app/oracle/product/11.2.0/db_1': Operation not permitted

I checked with cat /etc/sysconfig/selinux and SELINUX=disabled.

what could be the issue? Please suggest

thanks,
cdhar
 
Old 07-27-2012, 09:54 AM   #2
Sydney
Member
 
Registered: Mar 2012
Distribution: Scientific Linux
Posts: 147

Rep: Reputation: 36
Is the file open? I think this is a running DB.

Quote:
lsof | grep db_1
Also doing a long list may provide some extra information for this thread.

Quote:
ls -l u01/app/oracle/product/11.2.0/db_1
 
Old 07-27-2012, 10:01 AM   #3
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
The reason that your change is not permitted is that you are trying to give gbuora:gbuinst access to /home/cdhar/u01, but becuase of the location (/home/cdhar) gbuora:gbuinst does not have permission to the path to get there. If you look at the heirarchy of the permissions:

drwxr-xr-x. 5 root root 4096 Dec 1 2011 home (Only root can create the user's home directory in /home)
drwx------. 30 cdhar cdhar 4096 Dec 1 2011 cdhar (Only the USER cdhar has ANY access to the home directory /home/cdhar)

No one else but the user (and root) can even SEE what is in that folder, so access cannot be given. You would have to change the permissions starting at /home/cdhar in order to grant someone else access.

The permissions would have to look like this:
drwx---r-x. 30 cdhar cdhar 4096 Dec 1 2011 cdhar (This would allow ANYONE access to read and execute anything in your home directory and below

Keep in mind, this is giving other user's access to your HOME DIRECTORY.... not exactly a safe thing to do...
 
Old 07-27-2012, 05:31 PM   #4
sharadchhetri
Member
 
Registered: Aug 2008
Location: INDIA
Distribution: Redhat,Debian,Suse,Windows
Posts: 179

Rep: Reputation: 23
Quote:
Originally Posted by netnix99 View Post
The reason that your change is not permitted is that you are trying to give gbuora:gbuinst access to /home/cdhar/u01, but becuase of the location (/home/cdhar) gbuora:gbuinst does not have permission to the path to get there. If you look at the heirarchy of the permissions:

drwxr-xr-x. 5 root root 4096 Dec 1 2011 home (Only root can create the user's home directory in /home)
drwx------. 30 cdhar cdhar 4096 Dec 1 2011 cdhar (Only the USER cdhar has ANY access to the home directory /home/cdhar)

No one else but the user (and root) can even SEE what is in that folder, so access cannot be given. You would have to change the permissions starting at /home/cdhar in order to grant someone else access.

The permissions would have to look like this:
drwx---r-x. 30 cdhar cdhar 4096 Dec 1 2011 cdhar (This would allow ANYONE access to read and execute anything in your home directory and below

Keep in mind, this is giving other user's access to your HOME DIRECTORY.... not exactly a safe thing to do...

Can you give these 3 reply.

(1) lsattr /home/username
(2) df -Th
(3) ls -ld /home/cdhar/u01
(3)
 
Old 07-29-2012, 05:28 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This
Code:
mkdir -p /u01/app/oracle/product/11.2.0/db_1
creates the dir path starting at the system root '/', NOT from /home/cdhar ...
 
Old 07-29-2012, 06:37 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
hi chrism01

i was just about to post that error

cdhar

as i was reading the thread
the command you gave DID NOT make a folder IN your home folder
the "mkdir" command made this
/u01/app/oracle/product/11.2.0/db_1
( think if it like on Windows )
C:/u01/app/oracle/product/11.2.0/db_1
and you ran the command FROM your NORMAL user home folder
home/cdhar/
( think if it like on Windows )
C:/home/cdhar/

so when you RAN THIS command IN your home folder
Code:
chown -R gbuora:gbuinst u01
there IS no file ,called u01 ,IN your home folder TO have the command ran on
hence the errors

PS. also DO NOT disable SELinux!!!!
( would you turn OFF the AV software,Firewall, and UserAccessAuthentacation on Windows??? - NO !!! )

for testing and FINDING and FIXING error set it to PERMISSIVE
THEN after you have fixed SE errors
set it to ENFORCING

Last edited by John VV; 07-29-2012 at 06:40 PM.
 
Old 07-30-2012, 08:23 AM   #7
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
using mkdir -p /path/to/create as a user should have failed anyway due to lack of permissions..... unless cdhar gave his user root permissions....

I missed the -p earlier....
 
Old 07-30-2012, 11:00 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Looks like he's in as root, according to post #1
Code:
[root@hdk01ytt cdhar]#
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] chown: changing ownership of `<file>': Operation not permitted schuurs Linux - General 14 06-26-2013 05:15 PM
5.32. Changing Ownership - Operation not permitted basheer Linux From Scratch 6 05-17-2012 04:57 AM
chown: Operation not permitted ocicat Linux - General 4 05-08-2012 06:01 AM
[SOLVED] changing ownership : operation not permitted janakiramulu Linux From Scratch 69 05-09-2011 01:45 AM
changing ownership of 'file name' : operation not permitted Virgil B Linux - Newbie 9 10-15-2010 05:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration