Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Set a user's home directory from the Terminal UNIX
You can change a user's login directory from the command line using niutil. This is very helpful if you want to chroot users to their webserving directories under /Library/WebServer/Documents.
sudo niutil -createprop . /users/shortname home \
Replace shortname with the user's shortname, and you should be done.

[Editor's note: I added the backslash to narrow the displayed command's width. If you enter this as one line, you do NOT need the backslash! Note that I haven't test this hint myself, but it should work as described based on niload's man page.]
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)

Set a user's home directory from the Terminal | 1 comments | Create New Account
Click here to return to the 'Set a user's home directory from the Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
This hint still works on Jaguar.
Authored by: BrunoUsesBBEdit on Mar 25, '04 10:20:02AM

I was pulling my hair our because I could get ssh to allow me to log in with rsa (or dsa) keys. Turns out that since my home directory was /Library/WebServer/sites/Customer_Name on my hosting company, I was running into problems.

See, even if you create the public key right, and put it in ~/.ssh on the remote machine, you have to get the permissions right. I couldn't find this first item documented anywhere:
1. You have to be the owner of your home directory.
2. The group of your home directory must not have write permissions.
3. The ~/.ssh directory must be chmod 700
4. The ~/.ssh/authorized_keys2 file must be 600

All of the developers on my project shared the same home directory, which is cool enough to. But, if you was to use CVS with SSH, and not have to enter a password for every action, OR if you want to use any of the Mac GUI apps on the market. You better get you own home.


--==<< B r u n o >>==--

[ Reply to This | # ]