Differences

This shows you the differences between the selected revision and the current version of the page.

howto:changehomedir 2009/05/12 21:52 howto:changehomedir 2017/09/06 18:38 current
Line 1: Line 1:
====== How to change the homedirectory for users? ====== ====== How to change the homedirectory for users? ======
- 
This is important if you want multiple users to access your NAS through SSH, or just simple have a home directory for settings in shell commands such as midnight commander. By default, new users made on the webinterface do not have a home directory. First thing to do is create those directories and give ownership: This is important if you want multiple users to access your NAS through SSH, or just simple have a home directory for settings in shell commands such as midnight commander. By default, new users made on the webinterface do not have a home directory. First thing to do is create those directories and give ownership:
 +
 +===== create directories and give ownership: =====
 +
''mkdir /ffp/home; ''mkdir /ffp/home;
Line 8: Line 10:
chown test /ffp/home/test/'' chown test /ffp/home/test/''
 +
 +===== create startup script that changes homedirectory =====
 +
Because NAS resets the Home directory of the users (i dunno why), create a startup script that changes the homedirectory for the users: Because NAS resets the Home directory of the users (i dunno why), create a startup script that changes the homedirectory for the users:
''echo "!/bin/sh" > /ffp/start/sethomes.sh; ''echo "!/bin/sh" > /ffp/start/sethomes.sh;
 +chmod +x /ffp/start/sethomes.sh''
 +
 +For each user append the script with the following:
 +''
echo "usermod -d /ffp/home/test test" >> /ffp/start/sethomes.sh; echo "usermod -d /ffp/home/test test" >> /ffp/start/sethomes.sh;
-chmod +x /fpp/start/sethomes.sh''+'' 
 + 
 +===== Alternative: home folders on different drives =====
If you like you home directory available through /home, next to root and ftp, which is more elegant then do the following: If you like you home directory available through /home, next to root and ftp, which is more elegant then do the following:
''echo "!/bin/sh" > /ffp/start/sethomes.sh; ''echo "!/bin/sh" > /ffp/start/sethomes.sh;
-echo "ln -s /ffp/home/test/ /home/test";+chmod +x /fpp/start/sethomes.sh'' 
 + 
 +And for each user: 
 +''
echo "usermod -d /home/test test" >> /ffp/start/sethomes.sh; echo "usermod -d /home/test test" >> /ffp/start/sethomes.sh;
-chmod +x /fpp/start/sethomes.sh+echo "ln -s /ffp/home/test/ /home/test" >> /ffp/start/sethomes.sh;
'' ''
That's it. That's it.

Navigation

Personal Tools