All of folders in /etc are readonly in centos [closed] - centos6

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am trying to run an installer in CentOs,But all of folders in /etc have read-only permission,So I can run anything.All of folders have a lock image beside them.
Beside I am admin and use account root.
What should I do to have correct permissions?

I'm assuming that you wanna change the permissions to read and write for all the Files and Folders within the /etc Folder
run the following code
chmod -R 0777 etc
additionally you can change ownership of the folder using the chown command i.e
chown -R owner:group etc
Regards

Then the installer don't have root access. You must open/start the installer as root. If you are using command line to run this installer you must type sudo [whatever command you are using]

This should work
chmod -R +w /etc
As it gives write access for you to everything under /etc

Related

Changing user ownership to match group? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I mistakenly ran chown -R admin / on Centos 6
Is there any command to change user to match group? I think this should be a fix since by default user=group?
P.S. An OS reinstall can fix this, but I am looking for alternate solutions to avoid this.
Well, "admin" isn't a standard user, guess you added it or you wouldn't have such an issue.
If that command really worked I guess the first issue may be to login as root but assuming you can at lest get to the state that you can do that you have a few options (besides restore from backup or rebuild).
You can use rpm to restore owner/permission of any file handled by rpm.
rpm --setugids coreutils
or to do all of it at once (which I strongly discourage you from doing)
rpm --setugids $(rpm -qa)
dunno what the impact would be of that since when I did a quick test in lab it gave me a ton of "file not found" errors.
As for your original question, haven't seen any "user=group" option but you could do something like
find /home -user admin ! -group admin|while read i;do echo chown --no-dereference $(stat -c %g "$i") "$i";done
and if that looks good run it without "echo"
find /home -user admin ! -group admin|while read i;do chown --no-dereference $(stat -c %g "$i") "$i";done

What is the diffrernce between cd ./dirname vs cd dirname? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
cd ./dirname and cd dirname both seem to take me to immediate subdirectory.
Is there any underlying difference apart form the syntax?
The former will work for directories with (a certain set of) "strange" names.
cd ./-P
cd ./~
There is no practical difference.
It is simply two alternate notations of a path. And since the cd command accepts a path as a runtime argument you can use both notations. But it does not make a difference in that situation.
This does make a difference in other situations. For example when trying to execute a file the ./ prefix forces the shell to look for the executable in the current directory, not in the environment PATH.
The command cd ./dirname explicitly say you want to go to the dirname directory in the current folder

Unable to edit file UNIX [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am trying to edit a file in vi editor - and when I try to save the changes it says READ ONLY. Even when I try to do a chmod I get an error saying I cannot do so.
I have logged in Unix using a personal ID and not a service one
Because you aren't owner of this file. You need to sudo vim with an owner user.
Try opening editing the file in vim using: sudo vim <filename>
Some people also recommend adding this to your .vimrc file so you can open the file without sudo then write to it anyway using :w!!
" Sudo to write
cnoremap w!! w !sudo tee % >/dev/null

What is the difference between the Ubuntu ~ directory and / directory? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm new to Ubuntu and trying to understand the differences between these two directories. I need to know where node packages, git projects, and dotfiles can be installed to avoid future problems. Does anybody have a quick layman's answer?
I navigate to each directory in the following ways:
cd ~
or
cd /
Under which of these directories should I install my dotfiles?
Under which of these directories should I install my git projects?
I'm using Git Bash but I can't locate the directory on my machine for git checkouts.
See official documentation for the Ubuntu directory tree. It provides a basic explanation of the hierarchy and purpose of each directory.
cd / is taking you to your "top" or root level directory.
cd ~ is taking you to your current user home directory within /home/ (ex: /home/username).
Typically, you'll want to place your dotfiles in your user home directory (~/). If you look at some of the projects in the link you provided, they suggest this as well.
As for your git projects, those can go wherever you see fit. I prefer to place them within ~/ but it is really a matter of preference.

Help with file permissions in Unix [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have given a text file in my home directory the permissions 644. Another user logged into the same machine cannot read or copy my file. Why is this?
probably because the group lacks (read and) execute permissions on the parent directory/directories.
E.g.
mkdir /tmp/secret
chmod 600 /tmp/secret
touch /tmp/secret/publicfile
chmod 644 /tmp/secret/publicfile
/tmp/secret/publicfile will not be accessible to group members.
There are also POSIX ACLs and or xattrs (extended attributes) that might be interfering. Besides that only AppArmor, SELinux policies come to mind.
Oh and group membership becomes active on the next login (so if users were recently added to the particular group, they might just need to relogin)
Perhaps you mean the privileges not the mask.
644 means that this user can write and execute, but cannot read nor copy. You could try 655 which means: other users can read and execute my file.

Resources