Problems managing user

I installed Solaris 10 in an old Dell computer given to me. The filesystem is ZFS (Default).

The problem is that after logging in as root (first login) I wanted to add a user : n2jkw.

I added the user at /export/home/n2jkw

BTW, /export/home is where the 150G extra Hard Drive is mounted to. The system files reside in the 20G (boot) Hard Drive.

When I try to login to the local machine I get a black screen.

I wanted to do this to learn about Solaris-10 because I had a class on Solaris at the local Community College over a year ago... another is because I do like to challenge myself when I do things and the only way to make things "stick" is by hands on experience.

I am a computer major at University of Phoenix, but Software Engineering does not require Unix...but why not learn it anyway.

Thank all in advance...

Javier Maldonado

---------- Post updated at 01:29 PM ---------- Previous update was at 01:28 PM ----------

The black screen happens when logging in as n2jkw. As root, the computer loads to the Java desktop environment.

Sorry I was not specific.

Javier Maldonado

---------- Post updated at 01:53 PM ---------- Previous update was at 01:29 PM ----------

I do get a console if I log in as n2jkw from a remote computer and get to my home directory /export/home/n2jkw.

Again, my knowledge is limited at best.

Thanks again.

Javier Maldonado

tell us how you created the user... also give outputs of:

ls -l /export
ls -l /export/home
cat /etc/passwd
df -h

and:

ls -la ~n2jkw

Here is the output that you requested. Thank you!

# ls -l /export
total 4
drwxr-xr-x   4 root     root         512 Oct 14 13:05 home
drwxr-xr-x   3 root     root         512 Oct 12 05:44 home0
# ls -l /export/home
total 18
drwx------   2 root     root        8192 Oct 12 05:29 lost+found
drwxr-x---   5 n2jkw    100          512 Oct 16 06:05 n2jkw
# cat /etc/passwd
root:x:0:0:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
smmsp:x:25:25:SendMail Message Submission Program:/:
listen:x:37:4:Network Admin:/usr/net/nls:
gdm:x:50:50:GDM Reserved UID:/:
webservd:x:80:80:WebServer Reserved UID:/:
postgres:x:90:90:PostgreSQL Reserved UID:/:/usr/bin/pfksh
svctag:x:95:12:Service Tag UID:/:
nobody:x:60001:60001:NFS Anonymous Access User:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:
n2jkw:x:100:101:Javier Maldonado:export/home/n2jkw:/sbin/sh
# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0d0s0        5.1G   2.8G   2.3G    56%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   766M   876K   766M     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
                       5.1G   2.8G   2.3G    56%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   766M    52K   766M     1%    /tmp
swap                   766M    24K   766M     1%    /var/run
/dev/dsk/c0d1s7        147G    64M   145G     1%    /export/home0
/dev/dsk/c0d0s7         13G    93M    13G     1%    /export/home
/vol/dev/dsk/c1t0d0/s10_1009_software_companion
                       649M   649M     0K   100%    /cdrom/s10_1009_software_companion
# ls -la ~n2jkw
~n2jkw: No such file or directory
#

This is incorrect:

n2jkw:x:100:101:Javier Maldonado:export/home/n2jkw:/sbin/sh

Should be

n2jkw:x:100:101:Javier Maldonado:/export/home/n2jkw:/bin/ksh

The home directory is missing a leading "/". The shell change is just an advice as "/sbin/sh" isn't designed to be anyone's shell.

1 Like

Ok I will make the change and post the results. BTW, anything else that jumps at you looking at the output?

Thanks
Javier Maldonado

@DukeNuke2: Hmm, what makes you feel a "/" is need here:

ls -la ~/n2jkw

?

It actually breaks what I was looking for which is defined here: Shell Command Language

1 Like

got it...

Duke:

# Ls -la ~/n2jkw

gives me the same results: No such file or directory.

BTW, is this where the user configuration files resides?

Javier Maldonado

this is where they SHOULD be... if you created the user with the right options... and the missing / in the passwd file shows that you don't... maybe you should remove the user and create it again with the "useradd" command.

1 Like

That should be

# ls -la ~n2jkw

and that would only work with a POSIX compliant shell like ksh or bash but I'm afraid you are using /sbin/sh which isn't.

No, that's a shortcut to the user home directory.

Ok Duke..

I will remove the user and then use the useradd command.

Keep you posted....thank you guys...great school!:b:

Javier Maldonado

Duke and jlliagre:

I used userdel to get rid of n2jkw.

I revized the passwd file to confirm that it was removed, and it was.

Next I used useradd n2jkw

Next vipw (I did not modify the files, passwd and shadow file. I just look at them even though I invoked an editor):eek:

I confirmed that user n2jkw was created, it was created and the default directory given by system was /home/n2jkw, but the directory was not created by the system.:eek:

Next, vipw

Modified file passwd for user n2jkw: replaced home directory like this --> /export/home/n2jkw as directory for user n2jkw and typed my full name in the comment space.

Did not modify shadow file.

Next: #passwd n2jkw (I entered new password for user)

this is the result:

$ ls -l /export
total 4
drwxr-xr-x 4 root root 512 Oct 14 13:05 home
drwxr-xr-x 3 root root 512 Oct 12 05:44 home0
$
$ ls -l export/home
total 2
drwxr-xr-x 11 n2jkw 101 512 Oct 15 23:58 n2jkw
$
$ cat /etc/passwd
root:x:0:0:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
smmsp:x:25:25:SendMail Message Submission Program:/:
listen:x:37:4:Network Admin:/usr/net/nls:
gdm:x:50:50:GDM Reserved UID:/:
webservd:x:80:80:WebServer Reserved UID:/:
postgres:x:90:90:PostgreSQL Reserved UID:/:/usr/bin/pfksh
svctag:x:95:12:Service Tag UID:/:
nobody:x:60001:60001:NFS Anonymous Access User:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:
n2jkw:x:100:1:Javier Maldonado:/export/home/n2jkw:/bin/sh
$
$ df -h
Filesystem size used avail capacity Mounted on
/dev/dsk/c0d0s0 5.1G 2.8G 2.3G 56% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 701M 884K 700M 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
5.1G 2.8G 2.3G 56% /lib/libc.so.1
fd 0K 0K 0K 0% /dev/fd
swap 721M 21M 700M 3% /tmp
swap 700M 24K 700M 1% /var/run
/dev/dsk/c0d1s7 147G 64M 145G 1% /export/home0
/dev/dsk/c0d0s7 13G 119M 13G 1% /export/home
/vol/dev/dsk/c1t0d0/s10_1009_software_companion
649M 649M 0K 100% /cdrom/s10_1009_software_companion
$
$
$ ls -la ~n2jkw
~n2jkw: No such file or directory
$

Logged off root and logged in as n2jkw

!SUCCESS!:D:D:D:D:D

It all worked.

Now I have questions.....:rolleyes:

Why directory /home/n2jkw was not created @ useradd n2jkw....?

Is this because the ZFS filesystem did not allowed it?

How do I tell the system to add users @ /export/home by default?

BTW, this whole reply was in the actual machine that we are working with and logged as n2jkw.....:b: way to go guys...:smiley:

Javier Maldonado

Because you didn't ask useradd to do it.

Hopefully not.

That's expained in the useradd manual page:

useradd -b /export/home -c "Javier Maldonaldo" -m -s /bin/xxx n2jkw

with xxx being ksh or bash or whatever shell but not sh on Solaris 10 and older otherwise you will be frustrated by the shell lack of features.

Thanks for the information. Do I just change the shell in the passwd file?
replasing sh with ksh?

Javier Maldonado

Note: No wonder I do not have man pages and other stuff....

The shell (sh) was put there by the useradd command...

How do I change the hostname from noname to something else?

A safer method would be that one:

# passwd -e n2jkw    
Old shell: /bin/sh
New shell: /bin/ksh
passwd: password information changed for n2jkw

Then you should install them. It doesn't make sense administering a system without having the manual pages available.

I know, that's the reason why I advised you to modify that setting (twice).

1 Like

As you know I am learning this thing....I do appreciate all the advice.

Having said that, I was under the impression that the shell would do that, but I am not sure if changing the PATH would do it....

Thanks

Javier Maldonado

All my books assume that the system is installed and running....none of my books start with installation and options to customize the system.....

An example .... the hostname.....I missed to name my system during install...I can do:

#hostname Solaris-10

Now when the system re-start...the boot config have not change? is this correct?

Javier

"do that", "do it" ? I'm afraid I have no idea about what you are referring to ...

Mixed case names are accepted but I wouldn't advice using them. You might be hit one day by some bug. Better to stick with the all lowercase names Unix tradition.

Yes. The hostname command is transient. Use /etc/nodename for something permanent.

1 Like

I was refering to the man pages....:o

Thanks a lot for all the info. I think I am going to bed now...:eek:

Time sure flies.....:eek:

Javier Maldonado