Solved

Chmod....Operation not permitted

Posted on 2013-11-15
14
4,094 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 

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
 
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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Configuring Apache Camel to send and recieive from QPID Broker 2 29
000webhost.com default error log 1 57
awk to variable in bash 2 107
bash file 10 63
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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