How to create user account in Solaris

If you’re coming from Linux flavor, you might notice creating user account in Solaris slightly different as you need to provide few options as this is commonly ignored in Linux.

useradd [-c comment] [-d dir] -m [-g group] -s /bin/bash <login_name>

-c comment
Any text string. It is generally a short description of the login. Please put the user’s full name.

-d dir
The home directory of the new user. Usually the directory is /export/

-g group
New user’s primary group membership. We can get the group name from /etc/group file.Read More

How to change IP address in Unix Solaris

To change IP address in Unix server (Solaris), you need to edit the following files.

  • /etc/hosts
  • /etc/hostname.**
  • /etc/rc2.d/S70staticroutes
  • /etc/inet/ipnodes

The “ipnodes” file in latest Solaris 10 release is a softlink to /etc/hosts, therefore it will be reflected upon editing /etc/hosts file. So manual changes is not required.

How to grep recursively in Solaris

If you are from Linux background, you will find irritating that Solaris’s grep command does not support -r switch to perform recursive grep. But, don’t worry, there is a workaround in Solaris to perform grep recursively using the piped command as below.

find . | xargs grep 'Your Grep Value'

How To Set Time Using NTP In Solaris

NTP is stand for Network Time Protocol. It is used for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. NTP uses UDP on port 123 as its transport layer.

Keeping the date/time synchronized throughout all computers / servers is really necessary. Solaris already comes with the ntp daemon, called “xntpd”.

  • Check whether NTP daemon┬ástatus
    root@server:~# svcs -a | grep ntp
    disabled May_11 svc:/network/ntp:default

Read More