SOLARIS ADDING NEW USER ACCOUNTS
useradd command use to add a new user to the /etc/passwd and /etc/shadow and /etc/user_attr file. Before adding a new user you need to setup defaults by specifying useradd -D with the combination of options which sets the default values for the respective fields. So that Subsequent useradd commands without the –D option use these arguments. It will save your time.
# useradd -D -b /export/home -g pusers
Output:
group=pusers,100 project=default,3 basedir=/export/home
skel=/etc/skel shell=/bin/sh inactive=0
expire= auths= profiles= roles= limitpriv=
defaultpriv= lock_after_retries=
Where,
-b : Base home directory
-g : Primary group
Now add a user rockyjr:
# useradd -m rockyjr
# passwd -f rockyjr
Where,
-m : creates a home directory for rockyjr user.
-f : The -f option expires the password at first login, forcing the rockyjr to change it
Common option for useradd command
-u 1030 : Use UID 101
-g pusers : Specify user's primary login group
-G ftp,admin,www : Specify user's secondary group membership
-d /nas/home/user : Specify user's home directory
-s /usr/bin/bash : Specify user's login shell
Add a user from the command line in Solaris
This shows how to use useradd in Solaris to add a user.
You must be root (superuser) to add a user. An easy way to remember the syntax of the useradd command in Solaris is to run it with no options. Follow the resulting usage information including the parts that you require. Important options are:
-d home-directory-path
This is the new user’s home directory, typically /export/home/username
-m
make home directory and copy the default skeleton files (these files are located in /etc/skel directory).
-u uid
The uid (userid) is a number from 0 to 65535 which identifies the user on the system. uid 0 is reserved for root. If you don’t specify one, the next available uid will be used automatically.
-c “User Name”
Comment field which usually contains the name of the user. Make sure you enclose the name in quotes if it contains a space.
-s /path/to/shell
The shell to use. If you don’t specify this, it will default to /bin/sh. Make sure you specify the fully qualified path.
So, putting it together, a typical addition of a user named fred would be:
useradd -d /export/home/fred -m -s /bin/ksh -c "Fred Smith" fred
It’s a smart idea to run pwck (passwd check) whenever you make a change to the /etc/passwd file (as when adding or changing a user). This program will identify any problems with the passwd file. If it doesn’t tell you anything, then you are in good shape
Solaris adding group
You can use GUI tools or command line tools. I like to use command line tools for group admin. Use groupadd command to add (create) a new group definition on the system. Use groupmod command to modify a group definition on the system.
Adding new group
Use groupadd command to add group called pusers:
# groupadd pusers
Create a group called sshusers with GID 500:
# groupadd –g 500 sshusers
Add new user volini to group sshusers:
# useradd –d /nas/home/v/volini -m volini
Add existing user rose to group sshusers:
# usermod -G pusers rose
Rename group
Change the name sshusers to ftpusers:
# groupmod -n ftpusers sshusers
Delete the group
Remove the group called foxadmin
# groupdel foxadmin
If you manually modified the /etc/group file then you can check any group file inconsistencies with grpck command:
# vi /etc/group
# grpck
Solaris > How to configure LAN Card (NIC)
Following are generic steps
1) UNZIP or untar the driver
# gunzip -cd driver-x.y.z.tar.gz | tar xf -
2) Install the driver by running special install script, for e.g.
# sh install
OR
# chmod +x install; ./install
3) Or you can also try out as follows to install driver:
# /usr/ccs/bin/make install
4) Or if driver in package format then install it using pkgadd command:
# buzip2 driver.bz2
# pkgadd -d driver
5) Open /etc/hostname.driver0 i.e. if your lan card driver name it tu or rtls then you can set up the ip address as follows:
# vi /etc/hostname.tu0
192.168.1.1
OR
# vi /etc/hostname.rtls0
192.168.1.1
6) Then restart Solaris computer/server by typing following command:
# init 6
Complete example to install tu lan card driver (DAVICOM DM9102A or ADMtek AN983B chipset )
1) Download the file from authors web site.
2) Untar driver files using following commands:
# gunzip -cd tu-0.9.10.tar.gz | tar xf -
# cd tu-0.9.10
3) Install the driver as follows:
# /usr/ccs/bin/make install
4) Assign IP address to LAN card:
# cat > /etc/hostname.tu0
192.168.1.1
Save file (by pressing CTRL+D).
5) Assign Hostname, if its not assign, open file /etc/hosts using text editor:
# vi /etc/hosts
Add/modify following text:
#
# Internet host table
#
127.0.0.1 localhost loghost sol9
192.168.1.1 sol9 sol9.nixcraft.com loghost
Save file (by pressing ESC + : + x!) exit to shell prompt.
6) Setup network ID and netmask as follows:
# vi /etc/netmask
Add the following line (your network ID):
192.168.1.0 255.255.255.0
7) In above example, 192.168.1.0 is network ID and 255.255.255.0 is netmask.
Now reboot your Solaris system as by typing following command:
# init 6
8) When system comes up type commands to verify NIC driver is working properly:
# dmesg|more
# ifconfig -a
SOLARIS ADDING NEW USER ACCOUNTS
Reviewed by Positive thinking
on
4:26 PM
Rating:
No comments