Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-19-2011, 11:14 AM
|
#1
|
LQ Newbie
Registered: Apr 2011
Posts: 3
Rep:
|
User access to directory on a server (SUSE 9.1)
I am new to Linux and need to add user access to a particular directory on a Linux server (SUSE 9.1).
Example: userBFA
Directory: server01/SMF
I am able to access the directory via telnet however I do not know the commands to add the user. userBFA needs read\write access to the SMF directory.
Please let me know if any additional information is needed.
Thank you!!!
|
|
|
04-19-2011, 11:34 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
You can use "useradd" command to add user's to your system. If you type "man useradd" you can get details of how to use the command.
You can give user access to a directory in several ways: As owner of the directory, as a member of the group that has access to the directory or using acls. You need to decide how you want to do it before you create the user as the group(s) you make the user a member of are important unless you make the user the owner of the directory. (Making the user the owner of the directory is OK if that is the only user that is going to access it but if others are using it then you don't want to do that.)
From what you wrote I gather the directory already exists. If so run "ls -ld server01/SMF" to see the permissions, ownership and group. (Note the path you list isn't "fully qualified" - in Linux paths start with / e.g. /server01/SMF or /home/server01/SMF or /opt/server01/SMF - since you listed a relative path I'm not sure what the full path is.)
You should see something like:
drwxr-xr-x 5 billybob users 4096 Apr 19 10:09 server01/SMF
The first field tells you it is a directory and has permissions (mode) 755. (Type "man chmod" to see information setting permissions/mode.) The 3rd field shows the owner (billybob) and the fourth shows the group (users). Type "man chown" and "man chgrp" for information changing owner and group.
ACLs are a bit more advanced and if not currently in use you probably don't want to mess with them.
|
|
|
04-19-2011, 12:43 PM
|
#3
|
LQ Newbie
Registered: Apr 2011
Posts: 3
Original Poster
Rep:
|
Quote:
Originally Posted by MensaWater
You can use "useradd" command to add user's to your system. If you type "man useradd" you can get details of how to use the command.
You can give user access to a directory in several ways: As owner of the directory, as a member of the group that has access to the directory or using acls. You need to decide how you want to do it before you create the user as the group(s) you make the user a member of are important unless you make the user the owner of the directory. (Making the user the owner of the directory is OK if that is the only user that is going to access it but if others are using it then you don't want to do that.)
From what you wrote I gather the directory already exists. If so run "ls -ld server01/SMF" to see the permissions, ownership and group. (Note the path you list isn't "fully qualified" - in Linux paths start with / e.g. /server01/SMF or /home/server01/SMF or /opt/server01/SMF - since you listed a relative path I'm not sure what the full path is.)
You should see something like:
drwxr-xr-x 5 billybob users 4096 Apr 19 10:09 server01/SMF
The first field tells you it is a directory and has permissions (mode) 755. (Type "man chmod" to see information setting permissions/mode.) The 3rd field shows the owner (billybob) and the fourth shows the group (users). Type "man chown" and "man chgrp" for information changing owner and group.
ACLs are a bit more advanced and if not currently in use you probably don't want to mess with them.
|
The user is already added and is a member of the domain. What I am getting stumped on is how to specify adding a particular user to have permissions. From what I have read, I understand how to give permissions but I haven't found anything to show me how to give permissions to a specific user. If I wanted to give billybob (as an example name you used) permission to this directory, I wouldn't know how to go about it. I am used to working with Windows servers so this is a learning curve for me.
I have been looking code up and I can only find code to specify for "all users" and not a specific user.
I appreciate your help and I hope you understand what I am trying to accomplish here.
|
|
|
04-19-2011, 02:33 PM
|
#4
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
"member of the domain". It sounds like you're talking about Samba setup (sharing files out to Windows from UNIX or Linux)?
|
|
|
04-20-2011, 08:52 AM
|
#5
|
LQ Newbie
Registered: Apr 2011
Posts: 3
Original Poster
Rep:
|
I figured it out. Thanks for your help!
|
|
|
04-20-2011, 09:46 AM
|
#6
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
Please post your solution. That way if anyone else has same issue in future they can find what you did to resolve it.
|
|
|
All times are GMT -5. The time now is 07:48 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|