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
So one of my colleges just did the above to try and fix some permission issues I got him to ctrl-C it quite quickly. The server seams to be ok but im worried.
What would the effect of "/." be, equivalent to "/"?
Any way to fix essential server permission that are now 777?
Every directory in Linux contains the two special directory names "." and "..". The ".." meaning "up-one" in the directory tree and the "." meaning the current node in the tree. This includes the root ("/") directory:
$ ls -la /
total 472
drwxr-xr-x 29 root root 4096 Nov 22 13:03 .
drwxr-xr-x 29 root root 4096 Nov 22 13:03 ..
So executing a command on the directory "/." is really saying "execute this command on the '.' directory inside of '/'", which is just the root itself.
As far as fixing the original permissions... I hope you've made system backups :)
The effect will be the same, so depending on how quick you where to stop this (and how fast your server is) there will be files (and directories!) with incorrect permissions. You should be able to use the find command (the -perm option) to find all files which now have the 777 permission.
If you have a backup system which properly retains permissions you could probably find a way to script the old permissions back if to many files are changed to do it manually. But without a backup there isn't much left but to run to the list of files with 777 permissions and fix them manually.
Related
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 10 years ago.
Improve this question
The process is like the following root is a file whose owner is root:
~$ ln root another_file
~$ ls -l another_file
-rw-r--r-- 2 root root 0 Jan 24 15:48 another_file
~$ rm another_file
rm: remove write-protected regular empty file `another_file'? y
~$ ls -l another_file
However, this won't work..
~$ ln root another_file
~$ chmod a+w another_file
chmod: changing permissions of `another_file': Operation not permitted
This is one of the unix priciples. It is perfectly all right. The reason simply is that you have write permission to the directory itself. That grants you control over all entries contained in that directory. You'd have a huge problem otherwise. Note that this rule is not limited to hard links, but to every entry in general.
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 10 years ago.
Improve this question
I have a Unix Aix Server which I log in.
When i try to create a file using touch filename.txt I get an error saying :
touch: 0652-046 Cannot create filename.txt
I have executed id and ls -lad . commands and posted the results:
Response of id : uid=290975(gaara) gid=10(audit)
Response of ls -lad . : drwxr-xr-x 2 sigadmin student 256 Jan 11 05:57 .
First, check file permissions.
ls -lad .
You'll get a response like this:
drwxrwxr-x 2 user group 4096 Jan 11 11:26 .
Those permissions indicate rwx (user) rwx (group) and r-x (others). I.e only user and group can create files in this directory (w=write permission).
Compare these to you own UID/GIDs.
id
In your case the directory is owned by sigadmin. Group student and others have no permission to create in this directory (r-x). So it's not supposed to work, since sigadmin is the only one having permissions to write in this directory.
might be donot have permission to create a file on that filesystem.
check the directory previleges.check who all have the write permissions in that directory.
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 10 years ago.
Improve this question
I need to edit a file which is read only. This file is located at a remote appliance. Through ssh I logged in to this as admin and I have the root access.
Command "ls -l" show the permissions of file as
"-rwxr-xr-x 1 admin root 952 Oct 30 02:01 file.sh"
I am not as such familiar with Linux but I searched and found that this above line means that the admin is the owner and he/she has the read and write permission.
But the file is appearing to be read only, I am unable to edit it. So I tried to change the permission using command chomd
[admin#appliance targetfolder]# chmod 666 file.sh
chmod: changing permissions of `file.sh': Read-only file system
But still it is just read-only.
Someone suggested to remount the folder which contains this file.
How will I remount it, I used
" mount -o remount,rw /folde1/folder2/targetFolder"
but It gave
"mount: can't find /folde1/folder2/targetFolder in /etc/fstab or /etc/mtab".
Problem is solved, I remounted folder by using "mount -o remount,rw /" and then edited the file, without changing any permissions, it worked.
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 10 years ago.
Improve this question
I am setting up a Linux web server running apache. I uploaded and untared my web sites files. The files in the main directory are all visible when I am SSH'd into the system. However, I am blocked from all subdirectories.
If I write:
# cd images
Then I get the error:
-bash: cd: images: Permission denied
I am signed in as ec2-user. I untarred the stuff as ec2-user and I doubt there was any permissions in the tar file since I created the archive on a Windows system.
The weird thing is that I am the owner of this directory. Here is a snippet of the command:
ls -l
drw-rw-r-- 19 ec2-user ec2-user 4096 May 4 04:09 images
When I do "sudo su" and then type the command cd images everything is fine.
Why do I get "Permission denied" as ec2-user if I am the owner and have rw permission?
You need execute permission too:
chmod +x images
should take care of it. The execute permission for directories translates to a "traverse directory" permission.
It misses executable bit on the directory which is essential to be able to cd in there.
A quick fix would be to run in the directory where you unpacked your stuff:
# find . -type d | xargs chmod a+x
If you have directories with spaces in them, use the following:
# find . -type d -exec chmod a+x "{}" \;
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 10 years ago.
Improve this question
A while back I bought a 1TB USB external drive. I formatted it ext4 in Ubuntu and copied a bunch of files / folders to it from several machines, all to /home/machinename/whatever, respectively.
At some point I ran a chmod -R shell command on it to change the permissions. That was months ago and I don't remember what I typed but it made the drive so I could only access its /home folder as root. This wasn't a problem because I could still access everything, but today I decided to try to fix it.
I went to my shell as root, went to that drive and typed:
chown -R rick:rick ./
chmod -R 666 ./
It seemed to work. That home directory and everything else in it now shows up as rw for each:
rick#rick64:/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee$ ls -l
drw-rw-rw- 7 rick rick 4096 2012-03-04 13:08 home
So, if I try to access that directory with the shell, I get:
rick#rick64:/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee$ ls -l
drw-rw-rw- 7 rick rick 4096 2012-03-04 13:08 home
rick#rick64:/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee$ cd home
bash: cd: home: Permission denied
rick#rick64:/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee$ _
When I access it with nautilus I can see the multiple machine names within the /home/ folder, but they all appear with a file icon. I can right-click on them and choose "Properties" but it won't let me see the permissions.
Am baffled. Why can't I access that folder? I'm the owner? I'm even the group. I have r/w privileges. What am I doing wrong?
You're neither trying to read (list) nor write (create a new entry) the directory. You want to enter it, therefore you need (slightly misnamed in the case of directories) exexute permissions.