User accounts in Solaris

Can you please tell me how to create a user account in Solaris?

Answer Wiki

Thanks. We'll let you know when a new response is added.

There two possible ways to follow to add new accounts: using the admintool application which is a graphical interface and using the useradd comman. Whatever way you choose to follow, some considerations always apply.

* There is no central administration of the user accounts, therefore each machine as its own accounts and the information are not shared;
* The login is a string of no more than 8 characters that can contain both letters and numbers, the period and the char. “-” and “_”. It as to begin with a letter and has to contain at least one non capital letter;
* The userid is a number that identifies the user on the machine. This number is used to indicate the ownership of the file. In the past no care as been used in assigning these numbers, especially, the same user can have different userids on the various machine of the lab. This fact creates a big mess when we move files from one machine to the other, because there are good chances that we will hold the ownership of our files. If that happen, we will not be able to delete, or modify files that originally belonged to us.
To overcome the problem, it is good policy to assign the same userid to the same user on different machines. However, because changing an usedid after the user has been used the system for a certain time is kind of complex (because you have to be sure that you change the ownership of each of his files) we are keeping alligned only the usedids of the new users.
When a new user has to be added, therefore, the first thing to do is to go on each machine and check which is the highest userid assigned. To do that, you can just read the file /etc/passwd and take a note of the number of the last user. However, because new user has already been added using this police, the highest numbers should already been aligned. For example, as I write, the highest numeber assigned is 1019. Therefore the next new userid should be 1020;
* For the group there is the same problem, the group ids are not equal on all the machines. Actually, there are also some groups that have been created without any logic. However, we do not use any restriction related to the group, therefore is less annoying. Nevertheless, from now on is a good idea to assign to all the user the same group id. For that purpose, a group named Lab exist on all the machines with the same groupid (106). Use this group as primary group;
* When a new account is created the shell to be used by the user has to be specified. At the moment, there are three shells available:
o Bourne shell: the most simple shell but also the most unconfortable. Its location is /bin/sh;
o C-shell: a c like shell. Located as /usr/local/bin/tcsh (or /usr/bin/csh, different version);
o Bash shell: the default shell for linux systems. Found under /usrlocal/bin/bash;
Ask the user which shell he/her prefers. If he/her does not know what a shell is select the C-shell, which is the most used and supported in our systems;
* You will also need to specify where the user home directory has to be created. Depending on the machine, there are different places that has been used for the purpose:
o Piemonte: /home1;
o Monviso e Cumiana: /space;

Using the admintool utility

The admintool utility is a graphical application that can be used to manage users, groups, printers, ect. You can access it from one of the menus under CDE but to be able to add users you will have to lauch it as root. So, just open a shell, become root and that execute admintool. I will not go much in detail on how to use this application because it is quite intuitive. Just remember the previous notes when you have to create an account. Also, if the user wants to use the Bash shell, select other from the relative drop down menu and enter the path of this shell (/usrlocal/bin/bash).
Using the adduser command

Let us explain this command by means of an example. Suppose you need to add a new use, whose name is Jack Frost. He will use the login santa, will receive the userid 1025, will belong to the Lab group and will use the C-shell. Depending on the machine you will have to use the following command:

* Piemonte: useradd -c “Jack Frost” -d /home1/santa -g 106 -m -s /usr/local/bin/tcsh -u 1025 santa
* Monviso e Cumiana: useradd -c “Jack Frost” -d /space/santa -g 106 -m -s /usr/local/bin/tcsh -u 1025 santa

Here the explanation of the parameters:

* -c: used to specify a comment for the account, usually the user name
* -d: used to specify the user home directory, put the correct base directory and than the login
* -g: used to specify the main group, put 106 (Lab)
* -m: used to specify that the home directory must be created
* -s: used to specify the path of the shell to use
* -u: used to specify the userid

Discuss This Question: 1  Reply

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • NuxShell added | Shell Accounts & Hosting
    [...] at Bits and bi.. Enabling Shell Access at Dreamhost Using Your Shell Account - B2NetSolutions blog User accounts in Solaris Boycott Novell » IRC: #boycottnovell @ FreeNode: February 1st, 2009 -.. A Random String of [...]
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: