LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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.

Notices


Reply
  Search this Thread
Old 06-13-2016, 02:26 PM   #1
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Rep: Reputation: 0
Sub Permissions/Access


Ok,

This may be a dumb question, and I could probably google the answer, but I figured you guys may be able to help me a bit faster.


I have a project at work were we are migrating countries from virtual servers to cloud servers. So far so good. No issues. Last week I was tasked with moving a country that was not so straight forward.


The issue is this:

we hold our user files in a custom directory lets call it "/x/yx/country"

Under that directory are the users home directories "Normally". With their ownership set to

"user:country"


However on this country there are sub cites listed under "/x/yx/" so for example there are directories called Houston, Clear Lake, Dallas etc. etc to designate which city the users are working out of. So if I go to /x/yx/Dallas I then see the user home directories for that city.


The problem is my users cant login due to permission denied on the .bash_profile and on their home directories themselves.

On the new server I created a group for the country, but I can seem to figure out the permissions for the sub cites.

in /etc/group I made the following


USA:x:111222: Houston, Clear Lake, Dallas

Thinking that would allow those cites to have access to that country. I was wrong.


I'm not sure if this makes senses at all, but any help would be appreciated.
 
Old 06-13-2016, 02:45 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Is "Houston" a group, a user, or just a directory in /x/yx/?
What is the primary group for a user, let's call him "Frank", located in Houston?

The reason I ask, is it sounded like the cities are just directories at first, but then you said that you added this to /etc/group:
USA:x:111222: Houston, Clear Lake, Dallas

But that wouldn't make any sense unless "Houston", "Clear Lake", and "Dallas" are users. /etc/group describes which users are members of each group. USA is the group, so what are Houston, Dallas, etc. doing there? What are they?
 
Old 06-13-2016, 02:55 PM   #3
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
Houston is a group. I'm sorry for the bad explication. I'm trying to word it without making a security risk lol.

The primary group for the user Frank would be Houston. That is how it is set up on the old server. But on the cloud server my boss wants it to be /x/xy/USA/Houston/Frank.

So to clarify on the orginial server the location is /x/xy/Houston/Frank

On the new server it is /x/xy/USA/Houston/Frank.
 
Old 06-13-2016, 03:25 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
So it sounds like Frank needs to be a member of both the Houston and USA groups, the /x/xy/USA directory should belong to the USA group, and the /x/xy/USA/Houston directory should belong to the Houston group. The confusion came from your /etc/group line, it appears as though you were trying to add a group (Houston) to another group (USA). Groups can't be members of other groups, but your users can be members of both the Houston and USA groups.
 
Old 06-13-2016, 06:19 PM   #5
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
that makes sense. Is there a way to grant access to Frank without punching him into the /etc/group file? The issue comes that I have 100+ users migrating and I cant add them all to /etc/group.
 
Old 06-13-2016, 06:24 PM   #6
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
So i just added Frank to USA and Houston, and i still got permission denied errors when trying to su over to him. Only after I blew up the permissions to 777 on /USA/Houston/Frank could I get it to login.


I should also add that our users dont get a command prompt when they login. They get a custom in house menu....I dont know why, but they do.
 
Old 06-13-2016, 06:50 PM   #7
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
ok I got it.

I had to change the permission on the /USA directory to 775, changed the city permissions to 765, and user permission to 774. This allows for the users to login and see their custom menu.

For ownership "we use a power user and admin group for country directories"

For USA chown poweruser:USA

for Houston chown poweruser:admingroup

for Users chown user:Houston


This may not be the best way to accomplish this, but we also have users that utlize Winscp to transfer files, and these permissions keep them inside their groups/home directories.
 
Old 06-13-2016, 07:25 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by chris_carr View Post
that makes sense. Is there a way to grant access to Frank without punching him into the /etc/group file? The issue comes that I have 100+ users migrating and I cant add them all to /etc/group.
Why not? You aren't trying to edit /etc/group by hand or something, are you? Just stick gpasswd in a for loop over user name and you'll have them all in the group in a matter of seconds.


Quote:
Originally Posted by chris_carr View Post
ok I got it.

I had to change the permission on the /USA directory to 775, changed the city permissions to 765, and user permission to 774. This allows for the users to login and see their custom menu.

For ownership "we use a power user and admin group for country directories"

For USA chown poweruser:USA

for Houston chown poweruser:admingroup

for Users chown user:Houston


This may not be the best way to accomplish this, but we also have users that utlize Winscp to transfer files, and these permissions keep them inside their groups/home directories.
Those permissions and ownership are very non-standard and horribly insecure. Is there a reason that EVERY user needs read access to EVERY OTHER user's home directory, or that every user has read/write access to the home directory of every other user in their region??? What purpose does that serve? Why wouldn't you just lock down every home directory to 700, and set up a neutral 3rd party directory with the necessary permissions for group collaboration? Sharing home directories between users gets very ugly very fast.
 
1 members found this post helpful.
Old 06-14-2016, 09:35 AM   #9
chris_carr
Member
 
Registered: Oct 2011
Location: Houston Tx
Distribution: RHEL 6
Posts: 57

Original Poster
Rep: Reputation: 0
If I set the user accounts to any other permission setting they cant login. Yes it is very non standard, because we have a very non standard shop. None of our Linux users use Linux in a traditional way. When they log in they do not get a command prompt. They get a custom menu to do their work. Like a an old school GUI. At no point do our users have access to anything we do not want them too. So dont freak on the permissions. Another reason they are set that is due to my company trying to use old insecure FTP to transfer files from linux to windows. So to remedy that I set them up with WinSCP. Again these permissions are the only way "that I could find" that would log the users into only their home directory once they get in via WinSCP. From there they can back out to other directories but they can not access anyone's files except their own.

I know this sounds crazy, and that is because it is. My company is in the dark ages right now, and I'm trying to get them to move forward. Its a process.


""Why not? You aren't trying to edit /etc/group by hand or something, are you? Just stick gpasswd in a for loop over user name and you'll have them all in the group in a matter of seconds.""


Because I dont have to. Its one of those things that if I do not have to do it, then why would i bother.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian Squeeze - remote access vs. local access permissions ?? billbrach Linux - Server 2 09-26-2012 04:29 PM
Samba access permissions pengStudent Linux - Server 1 12-08-2010 07:53 PM
Changing permissions for HD access Kramer Linux - Software 4 01-18-2006 03:18 PM
Netatalk Access Permissions nutthick Linux - Networking 1 12-14-2004 08:25 AM
Drive access permissions Stephanie Linux - General 5 05-22-2002 07:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration