Linux User Previlages to change Owner/Group [closed] - linux

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 9 years ago.
Improve this question
I have some files, for which user is nobody and group is nogroup.
How do i set user privileges so that my user can change user and group to myself.
I don't want to do it using root or sudo.
Thanks

Only owner of a file/directory can change permissions of the file/directory.
root/sudo can access any file/directory and modify any file/directory 's permissions.
So to answer your question only the users nobody and root can change the file/directory 's permissions.

Let me brief the permissions part a bit for you:
1. Changing the ownership of any file or folder can only be done by root.
2. Only the owner of the file/folder can change the group.
So, in your case you'll need root or sudo rights for performing those actions.
Hope it helps

Related

In linux,who can be a root user? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I were using windows but now I am shift to unix like os sucn as linux,fedora .Now I am confused what is root in linux os?Please explain me.
Root user is also known as superuser in Linux-based OS. Basically, root user is granted all permission to do various task on that system. This includes adding/removing normal user account, managing services, changing ownership of files/folder and many more.
Normally, it is recommended for system administrator to create another normal user account to perform day-to-day operations while root account should only use when necessary. Once the system administrator has completed the necessary task, he/she will then revert back to their normal user account immediately. It is because a mistyped of command using root account might lead to wiping all data in the system!
For more information about root, you can visit here and here. Hope it helps.

How can I set the permission of a .key file to be only accessed by nginx [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 9 years ago.
Improve this question
I have a SSL certificate key in the directory /etc/nginx/key, how can I set permissions to allow only the nginx process to access the key file?
Make the Nginx user own it, and then set the permissions to only owner like so:
chown /etc/nginx/key nginxUser
chmod 400 /etc/nginx/key
I chose 400 because no one should need to write to your key. Note that root will still be able to read and write to this. Also, replace nginxUser with the user that runs nginx, I don't know who that is off the top of my head.
If you really want to do that, as root do the following:
chown nginx /etc/nginx/key
chmod 700 /etc/nginx/key

Limited permissions on linux [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
I want to give a specific user on Linux some privileges to enable him to run commands like shutdown or apt-get. I don't want to use the SUID bit since there are other users that I don't want to let them use these commands.
How do I do something like this?
sudo would probably be the easiest way to do this. You'll want to add something like the following to the sudoers file
username ALL=(ALL) /sbin/shutdown, /usr/bin/apt-get
where username is replaced with the user's actual username. You should be able to google for some examples - here is one such page.
Editing the sudoers file can be done safely by using the visudo program.

Granting Access Permission to a file to a specific user [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 9 years ago.
Improve this question
In linux, how can I give access permissions to a file/folder to a specific person. In other words suppose I want to allow only and only user fred to be able to read a file, then how do I do that?
Note that I know about chmod and all, but Linux doesn't seem to provide a fine tuned access permission control where you can specify the access control of one specific user.
Thanks,
Alison
Unix uses discretionary access control (DAC) for permissions and access control. For better security SELinux provide mandatory access control (MAC). This is consider difficult for administrators to set up and maintain.
Use commands:
chown user_name file
chown user_name folder
chown -R user_name folder #recursive

How to change the login of a linux user? [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 an user on my system named: website1 with his password. I need to change the name of website1 to website2. I don't want to remove it and then create a new user because I would like that website2 keep the exact same permissions as website1 on the system. I only want to change the name.
How can I do this?
usermod -l login-name old-name
You can change it with the usermod -l command. Check the usermod manual for more information.

Resources