Solved

Chmod....Operation not permitted

Posted on 2013-11-15
14
3,753 Views
Last Modified: 2014-01-02
I am trying to change the permissions of an application file(xxx.cfg) permissions from 464 to 466. I am signing into the server with my administrative account.  My OS is RHEL 6.4.

ex. chmod 466 xxx.cfg

chmod: changing permissions of ‘.’: Operation not permitted

How can I change the permissions to this file?
0
Comment
Question by:gumball60
  • 4
  • 3
  • 2
  • +5
14 Comments
 
LVL 24

Expert Comment

by:mankowitz
ID: 39651125
it looks like you are trying to change permission of the current directory, called ".". Are you sure you are not using any wildcards, like

chmod 466 *
0
 

Author Comment

by:gumball60
ID: 39651182
Here is more info on the file.
ls -lrt xxx.cfg
-r--rw-r-- 1 root domain users 22090 Jun05 22:28 xxx.cfg
0
 
LVL 10

Expert Comment

by:172pilotSteve
ID: 39651206
It sounds like because you are using the wildcard, it is failing on the  first item in the directory listing, which is the "." entry, meaning the current directory.  

Because it is failing on that entry, perhaps it's not going to the next item, although I would have expected it to continue.

try chmod with the explicit filename:
chmod 466 xxx.cfg

Better yet, to make sure you're root:
su chmod 466 xxx.cfg

Let us know how that goes!
0
 

Author Comment

by:gumball60
ID: 39651217
No wildcards was used. I was in the directory where the file was located...then entered
chmod 466 xxx.cfg (xxx = filename)
0
 
LVL 13

Expert Comment

by:duncanb7
ID: 39651237
chown -R -v root xxx.cfg
chgrp -R -v root xxx.cfg
chmod 466 xxx.cfg    #(OR   su  chmod 466 xxx.cfg)
0
 
LVL 23

Expert Comment

by:savone
ID: 39651385
You said you are logged in as your administrator account.  What exactly is that?  There is no administrator other than root by default.

Another problem you might have is it looks like you have a group name that contains spaces.  I can see this causing issues as well.

-r--rw-r-- 1 root domain users 22090 Jun05 22:28 xxx.cfg

Try to change to root and make the changes.
0
 

Author Comment

by:gumball60
ID: 39651483
duncanb7 The application does not require root to have that level of control.

savonne  I noticed the 'domain users" too, that may be part of the problem.  I am a administrator with limited root permissions.

I cannot su to root
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 23

Expert Comment

by:savone
ID: 39651557
I am not sure I understand what that means "an administrator with limited root permissions".  

Are you using sudo?

Can you do this, run the following command and replace username with your "administrator" username (post results here).

id username

If you are not in the "domain users" group you do not have the correct access to chmod this file.
0
 

Author Comment

by:gumball60
ID: 39651620
eliminated uid, gid numbers....

id myusername
uid =(myusername), gid=(domain_users), group=(domain_users), (today_users), (ns_users), BUILTIN\users
0
 
LVL 13

Assisted Solution

by:duncanb7
duncanb7 earned 200 total points
ID: 39651627
Please try it again,

input username to what login name you access the linux shell
(if you are users, input your username)

chown -R -v username xxx.cfg
chgrp -R -v username xxx.cfg
chmod 466 xxx.cfg    


I got the same problem before and then fix it by chgrp and chown

if not

copy xxx.cfg junk
chmod 466 junk
ls -la junk
copy junk xxx.cfg  ( chmod is working)
0
 
LVL 23

Expert Comment

by:savone
ID: 39651689
Why did you eliminate the UID and GID numbers?  Can you also show the output of

cat /etc/group
0
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39651797
-r--rw-r-- 1 root domain users 22090 Jun05 22:28 xxx.cfg
id myusername
uid =(myusername), gid=(domain_users), group=(domain_users), (today_users), (ns_users), BUILTIN\users  

Open in new window


Let's make it clear - this account does not have limited root access. I think you need to be the owner to change the perm.

Have you ask someone with root access to run the same command to rule out a possible permission issue?
0
 
LVL 7

Expert Comment

by:expert1010
ID: 39653091
A bit late into the game but since no one else mentioned it. Are you sure you're using the right chmod? You might have a PATH that points to another place than the standard for chmod.


ls -l `which chmod`
file `which chmod`
0
 
LVL 10

Accepted Solution

by:
Luxana earned 200 total points
ID: 39654640
Hello,

just a thought. Make sure that your file from some reason is not have immutable or some other attributes assigned which may cause your problems:

Example:
touch foobar
ls -l foobar 
-rw-r--r-- 1 root root 0 Nov 17 17:07 foobar
chmod 777 foobar 
ls -l foobar 
-rwxrwxrwx 1 root root 0 Nov 17 17:07 foobar
chattr +i foobar 
chmod 666 foobar 
chmod: changing permissions of `foobar': Operation not permitted

Open in new window


Check your file with:
# lsattr yourfile 
----i--------e-- yourfile

Open in new window

to see whether this is the case. If yes remove any obscuring attribute with:
chattr -i yourfile 

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now