Technical article 109579

Users can't log in; they get "cannot change to home directory" and the login: prompt reappears.

OpenServer 6.0.0OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7UnixWare 7.0.0UnixWare 7.0.1UnixWare 7.1.0UnixWare 7.1.1UnixWare 7.1.2UnixWare 7.1.3UnixWare 7.1.4Open UNIX 8

Written · Last revised

Problem

I have created several new accounts on my system, but some users cannot log in. They enter the correct account name and password, but they get "CANNOT CHANGE TO HOME DIRECTORY" and are returned to the "login:" prompt.

- OR -

Some users' home directories seem to have disappeared.

Cause

This problem is most likely caused by one of the following:

1. New users were added whose home directories were in an additional (that is, non-root) filesystem, and that filesystem was not mounted at the time the home directory was created. This will cause the home directories to be created in the mount point directory in the root filesystem rather than in the additional filesystem itself. Then when the filesystem is mounted, the home directories will be hidden and the users will not be able to log in.

2. The automounter failed to mount the NFS filesystem containing
the users' home directories or the local filesystem did not get
mounted on bootup. It is also possible that the filesystem has
been unmounted for some reason.  If the users' home directories
were created with the target filesystem mounted, and for some
reason the filesystem that holds those home directories is not
mounted, the users' home directories will not be accessible.

Solution

1. Make sure the user's home directories were created with the
target filesystem mounted.  That is, make sure the home directories
are not in the mount point directory in the root filesystem.  To
check this, unmount the target filesystem.  For example:
# umount  /u
where /u is the mount point for the /dev/u filesystem.  When using
this command, be sure to replace /u with the mount point for your
additional filesystem(s).

With the filesystem unmounted, check the contents of the mount point directory:

# cd  /u
# ls -l
If the entries listed in /u are home directories that are meant
to be in the /u filesystem, re-create them when the /dev/u filesystem
is mounted to /u.  For instance, if there are a large number of
these home directories, you can first create a list of them:
# ls -l | grep "^d" | awk '{ print $9 }' > /tmp/dirlist

Then you can use this list to re-create them within /dev/u:

# mount  /dev/u  /u
# cd  /u
# cat /tmp/dirlist | xargs mkdir
where "/dev/u" is the device name of the filesystem and "/u" is the
mount point.

You can then change the ownership and group of these directories appropriately:

# for i in `cat /tmp/dirlist`
> do
> chown $i $i
> chgrp group $i
> done

where "group" is the general user group ID in this example; your chosen group(s) may vary, and thus the above procedure as well.

As a final step, you can unmount /dev/u once again and remove the directory entries in /u, provided they are empty directories.

2. If the accounts were created with the home directory filesystem mounted (correctly) and you are experiencing this problem, it is most likely because the filesystem that holds the home directories is not mounted. Use the mount command to view all currently mounted filesystems.

# mount

If the filesystem in question is not mounted, you can mount it from the command line:

# mount <device>  <mountpoint>

or from the filesystem manager. The filesystem manager (ScoAdmin -> Filesystem Manager) also allows you to set the filesystem to be automatically mounted on boot.

If you have configured the additional filesystem(s) to be
automounted, this problem could indicate that the automounter
failed, or is not set up for a particular NIS client.  Check the
console and log files (/usr/adm/syslog) for automount error
messages.
NOTE:

If you see the message "no shell" when trying to login apart from "root" then check that the owner of "/" belongs to "root" and has the permissions of 755.

This can be checked with OpenServer with the "/tcb/bin/integrity -e" command.

See also

mount(S), automount(NADM)

From the Xinuos technical article database, record 109579. Reproduced with permission. The original is at www.sco.com/ta/109579, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.