Jump to content

user home


zendril

Recommended Posts

Posted

I'm using 5.0b12 but I think this is just a general question and not 5.0 related. Feel free to move if it is.

 

I want to login via ssh for a user account (don't like logging into unraid with root) AND have it work after a restart.

 

I installed unMenu and have ssh setup just fine.

In order to allow a user to login I had to

  • change the shell from /bin/false
  • create a /home/username dir
  • update the users home to point to that

 

All of that worked just fine and I was able to login as the user account.

 

After a reboot of unraid it came up and all of those modifications were gone.

The /etc/passwd changes were reverted and /home was empty again.

 

Is this a 'feature' of unraid to wipe/reset all of this on a clean boot or something?

Is there a way to configure this so that it is persisted across restarts?

 

thanks,

-k

Posted

If you copy the passwd/shadow files back to the flash drive after your changes, they will be restored upon next reboot.

 

root@atlas ~ #find /boot -name passwd -ls

  5149    8 -rwxrwxrwx  1 root    root        1156 Nov 22 06:56 /boot/config/passwd

root@atlas ~ #find /boot -name shadow -ls

  7204    8 -rwxrwxrwx  1 root    root          66 Aug 15  2009 /boot/config/shadow

 

 

cp /etc/passwd /boot/config/

cp /etc/shadow /boot/config/

 

As for restoring /home you can either tar it up and write a script to untar it or rsync it somewhere before shutdown and rsync it back after rebooting.

 

storing /home on a cache drive in /mnt/cache/.home can work (Although it's not protected).

 

There is also the mount -o bind option where you mount some other directory on top of /home

 

Here's a chunk of my fstab.

 

root@atlas ~ #cat /etc/fstab

/dev/disk/by-label/UNRAID  /boot  vfat  auto,rw,exec,noatime,nodiratime,umask=0,shortname=mixed  0  0

/mnt/cache/.home          /home  auto  auto,rw,exec,noatime,nodiratime,umask=0,bind            0  0

 

root@atlas ~ #mount -v /home

/mnt/cache/.home on /home type none (rw,bind,noatime,nodiratime,umask=0)

 

You would need to alter the /etc/fstab in your go script or do the full mount command manually.

My cache drive is RAID1 so I'm not afraid of failure. although i do plan to switch my persistent directories to an SSD,

 

root@atlas ~ #mount -v -obind,rw,noatime,nodiratime,umask=0 /mnt/cache/.home /home

/mnt/cache/.home on /home type none (rw,bind,noatime,nodiratime,umask=0)

root@atlas ~ #mount | grep home

/mnt/cache/.home on /home type none (rw,bind,noatime,nodiratime,umask=0)

 

This is probably the easiest way as it only involves an extra command in the /boot/config/go script.

You can also choose a directory off /mnt/disk1/home or something like that of your choosing.

I really wish unRAID had a /homes directive for interactive user logins.

For how here are some solutions.

Posted

awesome replies guys..

 

thats what i wasn't aware of (being so new to unRaid) was that unraid is actually running memory..

 

i don't mind scripting it..

off to do some tinkering..

 

thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...