Some qeustions about Linux..

Hello,

Actually i have no idea where to put this thread but i’ll hope that you guys can help me out. I’ll have some qeustions that i need to know but so far i can’t find any clear answer and hoped that you guys can help me out.

Some qeustions are:

  1. Which option by the command useradd do you use together to specify a another shell?
  2. Suse does make every user to a primary group to number 100. Why is that so? And how is this by Ubuntu?
  3. From how many groups maximal can a user be member?

I’ll hope you can help me cuz i have no clue atm… maybe im searching wrong but i really can’t find it.

Greetings,

Rik

You say that you are asking general Linux questions. But this is the openSUSE forum, thus it is most likely that you will get openSUSE oriented answers.

1
Most people here do not use useradd, they use YaST (the system management tool of openSUSE). In YaST > Security and Users > User and Group Management there are all sorts of things that can be set on several tabs for users you introduce or on changing existing users and one is the login shell.

But when you want a strickt answer to your question, on every Linux system you must be able to do

man useradd

and that will tell you all. Amongst it, I see:

-s, --shell SHELL
The name of the user’s login shell. The default is to leave this field blank, which causes the system to select the default login shell specified by the SHELL variable in /etc/default/useradd, or an empty string by default.

Why not? There must be a default somewhere. But again, you can change that default in YaST, you can also choose another primary group for a (any) particular user. For Ubuntu, please go to Ubuntu. I have no idea.

I do not think there is a maximum to this. At least not for any normal usage. After all /etc/group is only a text file that can grow as well as in number of lines (number of groups) as in the line width (number of users added). Thus it comes down to how many lines of what length can be in a file. :wink:

But this being a security issue, you of course do not want a user to be a member of many groups. That would contradict with the security rationale behind it.

On 04/12/2016 01:26 PM, Rikt wrote:
>
> Some qeustions are:
>
> 1. Which option by the command useradd do you use together to specify a
> another shell?


man useradd:

-s, --shell SHELL
The name of the user's login shell. The default is to leave this field
blank, which causes the system to select the default login shell specified
by the SHELL variable in /etc/default/useradd, or an empty string by default.

> 2. Suse does make every user to a primary group to number 100. Why is
> that so? And how is this by Ubuntu?

Ubuntu… no idea. If you have experience there, please share.

Otherwise, the reason all users are part of the ‘users’ group is that it
makes it convenient for users to share things with eachother without
creating brand new groups, adding everybody to those groups, and also
finding a common location to share the files. This may not always be
desirable, but it’s easy to change.

> 3. From how many groups maximal can a user be member?

If you ever hit a limit, I’ll be surprised. I’ve seen systems with
thousands of groups per user, and hundreds of thousands of users per group.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Definitely not a hardware-related thread. I’ll move this to Install/Boot/Login…

Moved from Hardware forum.

This answer has been answered by previous posts. Whenever you have a question about any command, it’s usually possible to find the answer either in the abbreviated help

 *command *--help 

or the MAN pages for more in-depth explanation

man *command *

I have not inspected how Ubuntu manages its User security but would be surprised if it’s much different than openSUSE or any other distro. Unlike the previous description and functionality of the User group, I would say that this is just a common implementation of a practice called “Manage by Groups.” The idea is that if you have a potentially large number of objects (In this case individual User accounts) which should all be configured with same access permissions, then instead of configuring each and every User account individually, by placing all these accounts in the same Group you are able to automatically apply these same settings to all of them, vastly improving management efficiency and without error.

Hmmmm… I don’t know what the current limit is, but a few years ago it was at least 64k. Is that enough for practical use and further investigation not needed? :slight_smile:

TSU

The main difference is that Ubuntu set up a group for each user, meaning that userXX’s primary group is userXX. Hence different users have different primary groups. OpenSuse seems to group all users in a “user” group. I guess both strategies have advantages and drawbacks.

Both are default approaches. As system manager, you can of course do what you like.

It seems then that Ubuntu’s approach is that groups have no real use and thus users are not only separted according to their UID, but a second time through their GID. Thus any group permissions that are less restrictive that user permissions have no real impact.

In openSUSE, by default users primary group is users (not user!), the idea probably being that the system is a home PC or the like and that other users are either family members or the same human user in a different role. Which gives them a sort of grouping from the start.

I guess both try to cope with a public that did not invest to much energy in reading about Unix/Linux owner/group/permission technology and offer them decent defaults to live with.

As an Example of how I implemented groups. My wife and I are members of group wij, which is not only another name, but also another GID from users/100. users is still there, thus I can add a"guest" user quickly without him being member of wij. Another user I have is member of www, because I use that user for managing Apache, etc.