Help with file permissions in Unix [closed] - unix

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.

Related

how to setuid on a file, that is owned by some other user [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
How can I set setuid for a file, that is owned by some other user ?
I tried, setting the profile and changing the USER variable, but doesn't help .
Users can only set the setuid bit on their own files, or root can set them on any file. This is a security feature - if you could set the setuid bit on someone else's file, you could run it to become that user.
It determines who you are based on your actual login ID (you can see this with the id command), not the USER variable or whatever you mean by "setting the profile".

All of folders in /etc are readonly in centos [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 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

How to password protect a crontab in unix [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
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.
This question does not appear to be about programming within the scope defined in the help center.
Improve this question
We need to password protect the activities on the crontab, for ex even if we try
crontab -l
or
crontab -e
or
crontab -r
We would have to enter a password to go to the next level(viewing/editing/deleting) even if we are root user.
Kindly suggest some mechanisms.
Thanks.
If you don't trust the root user on your system I would say you have big problems. I don't think there is any way to securely protect anything from root - by definition this user can do what they like, including removing any protection you put in place to try to enfore a password when executing crontab.

removing a file 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 10 years ago.
Improve this question
In a UNIX filesystem, if the inode of the root directory is in the memory, what are the sequence of disk operations needed to remove a file in Desktop?
While I am trying to solve a question in textbook, I have seen this question but I could not solve it . Can anyone help me ?
If you know much about Unix, can you tell me what are sequence of disk operation needed for creating a file in Desktop ?
Use rm to remove files in Unix. e.g.,
rm file_to_delete
or better yet if you are uncertain about working in Unix
rm -i file_to_delete
which will prompt with the name of the file to be deleted to confirm the operation.
The file_to_delete can be in the current directory, or in some other directory as long as the path is properly specified.
See rm man page for more information.
As for creating a file, you can create an empty file with the touch command. I.e.,
touch some_file
will create an empty file named some_file. Again, this can be in the current directory, or any directory with the path specified.
For more information see the touch man page.
Your questions wasn't quite clear to me, so if this doesn't answer it please add a comment or (better yet) consider possibly rephrasing your original question or at least the title of your question (removing a file in unix)

How to copy Files from Network folder to Local drive and preserve permissions? [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 12 years ago.
Improve this question
Please close this question. I got what I am looking for and some are arguing it doesn't belong here.
All you have to do is zip the files on the mount and drop it in your local HD. All permissions are intact!
Is it possible?
I have a network disk mounted on Ubuntu. How do I save the files (folders and files recursively) from the network mounted disk to my local disk preserving permissions?
Thank you...
Use either rsync -a or cp -p, depending on your needs.

Resources