[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 432
  • Last Modified:

how to grant access in Linux repository server

hi all,

i would like to know how to grant access to an existing user in Linux repository server to access a folder?

normally, will access to the repository server through Window with the given IP. and then will see the list of the folder. so, the user need to access to one of the folder which dont have the access yet

please provide the steps if possible, this is my first time granting access.

thank you in advanced.
0
gagajanice
Asked:
gagajanice
1 Solution
 
gagajaniceAuthor Commented:
I tried to add the user to a group having access to that folder in /etc/group but still not successful.
0
 
upanwarCommented:
Could you please show us the listing of the folder which you want to share.

# ls -la <folder which you want to share>
0
 
Martin_J_ParkerCommented:
Giving access to the group in /etc/group won't help unless the user uses the "newgrp" command to switch to the other group.
 If the user types "newgrp groupname" then they will have access to files of that group name in that particular window.  
If the user types "newgrp - groupname" in a window/shell means that the environment will be re-initialised as if the user had logged in under that group name - but still for that one window or shell.

You could change which group they belong to in /etc/passwd but that may affect other privileges.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
spyresponseCommented:
using command

 chmod  666 < name of the user >  where 666 is ur alll acccess permision..
0
 
Martin_J_ParkerCommented:
You wouldn't use chmod on a username - you use it on file names.

Using chmod 666 is dangerous - that only applies to files and will bugger up sub-directory access.
It will also remove execute permission from scripts and programs, which you don't want to do.
If there are any special permissions like suid or guid set it will also remove those, which you also don't want to do.

Basically don't use numbers with chmod unless you really know what you are doing and what the effects will be.  I've seen people really screw up UNIX and Linux systems with the command "chmod -R 777 /"

Using 666 also gives read and write access to everybody, which may not be what the OP wants to do.

If you really want to give all access to a group of files use "chmod ugo+rw <filenames>" and for a directory use "chmod ugo+rwx <directoryname>"
0
 
gagajaniceAuthor Commented:
hi all,

thank you for all your reply.
manage to get the solution that i am looking from my colleague which is, "usermod -a -G groupname username".

therefore, i am going to close this question now.
 
0
 
Martin_J_ParkerCommented:
That's interesting - it used to be just adding to /etc/group was enough but it looks like the usermod command also adds the user to the group in /etc/gshadow - useful to know.  Nice one OP.  Glad you got it sorted.  
0
 
gagajaniceAuthor Commented:
hi all,

thank you for all your reply.
manage to get the solution that i am looking from my colleague which is, "usermod -a -G groupname username".

therefore, i am going to close this question now.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now