[SOLVED] New user with own rights, should only can access to his own directory and processes
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
New user with own rights, should only can access to his own directory and processes
I want to realize something. I hope, you can help me. And sorry for my english. I'm from germany.
I want to add an user, which has his own directory and can only access to this directory. He should not be able to use "/etc/init.d/..." or "/var/www/..." or something else. He should have his own directory, like that: "/home/<user>/..."
And there is it him allowed to do all, what root allowed him. This user in my example should be able to run a server (called "Minecraft") with his permissions and he should be able to remove, copy, move and/or edit some files of this server. This server files are all in his own directory (/home/<user>/).
But it isn't allowed him, to edit, create, move and/or delete something of a another direcotry, like "/var/www/" or "/home/root/...".
It isn't him allowed to use the root permissions. And he should be able to login via SSH on the server with his own credentials (username + HIS OWN password).
I hope, somebody can follow me and explain me, how I can create this user like described here.
The user will need to read some system directories such as /bin/, and /etc/ to be able to run programs.
Check the permissions on your server to make sure they aren't too permissive. A regular user can read /etc/init.d/ but not execute the files as root. Check the permissions for "other". Regular users not part of a httpd or www group shouldn't be allowed access to /var/www/.
If the server's filesystem uses the ACL mount option, you could use setfacl to deny this particular user access to files & directories.
You could use ALLOW USERS in /etc/ssh/sshd_config to list the users allowed ssh access. All other users will be denied. This is a quick and easy way to disallow all system users ssh access. Also consider using PUBKEY authentication for SSH.
Please be more specific. Are you saying the user can't edit his own file in his HOME directory? If not list the permissions and ownership of the containing directory (ls -ld <dir>) and of the files the user needs to edit. Consider adding the user to a group, if the directory and file ownerships use the group ownership for this purpose. You could also use setfacl to add permissions for another user or group. You can create a default ACL on the parent directory so new directories and files inherit the ACL.