Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4854
  • Last Modified:

Chmod....Operation not permitted

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
gumball60
Asked:
gumball60
  • 4
  • 3
  • 2
  • +5
2 Solutions
 
mankowitzCommented:
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
 
gumball60Author Commented:
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
 
172pilotSteveCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
gumball60Author Commented:
No wildcards was used. I was in the directory where the file was located...then entered
chmod 466 xxx.cfg (xxx = filename)
0
 
duncanb7Commented:
chown -R -v root xxx.cfg
chgrp -R -v root xxx.cfg
chmod 466 xxx.cfg    #(OR   su  chmod 466 xxx.cfg)
0
 
savoneCommented:
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
 
gumball60Author Commented:
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
 
savoneCommented:
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
 
gumball60Author Commented:
eliminated uid, gid numbers....

id myusername
uid =(myusername), gid=(domain_users), group=(domain_users), (today_users), (ns_users), BUILTIN\users
0
 
duncanb7Commented:
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
 
savoneCommented:
Why did you eliminate the UID and GID numbers?  Can you also show the output of

cat /etc/group
0
 
MazdajaiCommented:
-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
 
expert1010Commented:
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
 
LuxanaCommented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 3
  • 2
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now