changing login directory

Blaqb0x

Registered
Hi,

Im trying to use Windows file sharing on jaguar. I know linux but very new to *BSD/OSX

i created a guest account that I can login to from a PC and this works fine. However the thing I want to do is backup someone's profile on the machine(not guest's) I figure there are a couple of ways of doing this.

use the person's actual account to login(I don't want to do this)

change the guest accounts login dir to his Documents directory and give guest read permissions. the backup server Veritas Backup exec can then backup the whole directory.

I looked in the /etc/passwd file to edit the login dir for guest but guest isn't there. Im assuming it is in /etc/master.passwd however root is the only account that can read this file but he can't login as root? security feature? his account is admin and I couldn't change root's passwd.

Does anyone know how to change the login dir of an account?

thanx,
 
Two parts to this answer: the account you want isn't actually called "guest", and accounts aren't actually controlled by /etc/passwd.

"guest" is samba's term for this class of account. The samba config file maps this to a particular user on the system. In the case of osx, /etc/smb.conf appears to use an account named "unknown".

And unless you've changed lookupd's configuration, /etc/passwd is not actually used for authoritative user info. Netinfo is generally authoritative, and files like /etc/passwd are only used when netinfo isn't running, such as during single-user mode.

So you would actually want to change the home directory for the user "unknown" in netinfo. You can do that any of a few ways: you could use /Applications/Utilities/Netinfo Manager, and do it the gui way. Or you could use nidump and niload, which emulate unix text configfile behaviour. You could do something like "nidump passwd / > passwd", edit passwd to your liking, and "nidump -m passwd / < passwd".
 
Here is the general syntax for the command line method:
sudo niutil -createprop . /users/userx home "/Volumes/drivename/directory"
You're creating a property on top of one that already exists, overwriting the previous home directory (i.e. /Users/userx/) with the new one on another volume and directory altogether.

To confirm the changes, I recommend running this command both before and after you run the above command:
niutil -read . /users/userx

If you want the new home directory to truly be the user's, you would want to (instead of a shared folder that this user defaults to):
chown userx /Volumes/drivename/directory
or
chown -R userx /Volumes/drivename/directory
if files exist within the directory.
 
Back
Top