1

I need to create a user and only allow access to some folders on my server. The user also needs to be able to create an SSL Key with the command:

openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr

I know it is possible to do but I don't know how. Can someone help me?

Thanks!

2
  • 1
    This question is too broad. Is the user going to login via GUI or using SSH? Creating a user is going to give him access to a lot of directories. Do you need to give the user access to other directories? Do you need multiple user to access those directories too?
    – drkblog
    Commented May 22, 2014 at 1:06
  • well i need to create a user and this user can only access 2 directories, maybe if i create a group and put this user on this group
    – OpSSLby
    Commented May 22, 2014 at 1:51

1 Answer 1

2

You could create a group named opssl

# groupadd opssl

Now you can give access to that group:

# chgrp opssl /dir/folder1
# chgrp opssl /dir/folder2
# chmod g+w /dir/folder1
# chmod g+w /dir/folder2
# chmod o-rwx /dir/folder1
# chmod o-rwx /dir/folder2

Fist two commands set group ownership, the second pair gives the group write permission, and the third group removes access to anyone but owner and group.

Then create users within this group:

# useradd --gid opssl user1
# useradd --gid opssl user2

NOTE: this will give them access to those directories. Besides that, these users are like any other user you create there.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .