Adding user

Hello All,

New to Solaris, I added a new user by cmd " useradd -d /export/home/username -m username " but wondered when I tried to login with this new username, It doesn't automatically redirect to the user's home folder. Can anyone suggest about this?

does the directory "username" exist?

Yes, the directory is being created after running useradd command.

Got the solution. I was not running " su - user " to login . I was just running " su user ". By the way, thanks for reply.

It should. What is your current directory after login as username ?

Any error message ? Can you check the home directory has been correctly created ?

ls -la /export/home/username

Edit: Hmm, I was too slow ...

After logging with " su username " it was redirecting to "/ ".
Other question : how to add a hostname?
when I run command " hostname " , got reply
unknown

I think no name was given to this system. I tried to edit the file /etc/hosts, but it is showing read only file. Any idea?

Hope, you will help .

What's the result for

#more /etc/hostname.[NIC]

If you cannot perform the command so there's no file called /etc/hostname.[NIC]

You can create the file using vi

#vi /etc/hostname.[NIC]

enter the desired hostname

Don't do that unless you want to give a fixed IP address to that machine.

The best way would be to configure your DHCP server to provide a hostname along with an IP address, or to set the dhcp client not to ask for a hostname.

Your hostname should already be set in /etc/nodename.

I edited both files, and started the network service " svcadm restart network/physica " but when I check hostname by cmd:
#hostname
unknow is the out put.

Can anyone suggest how to change the hostname?

After making suggested changes, I started the service by
#svcadm start network/physical
After I run the cmd " hostname " to know the hostname. The output still comes as before
unknow
Please advice....