Alacard Posted March 3, 2020 Share Posted March 3, 2020 (edited) First of all im new to unraid, coming from a qnap nas, one of the feature that i found out unraid didnt support was "Home" shares. What that feature is, a share called "homes" and every user gets there own subfolder in that share that only they can access. seeing that all my users use this as a remote storage for Docs, Pics, etc. and just mapped the folder to windows to use. this is one feature i could not go with out. so Ive made some "tweaks" to unraid to be able to have this feature and wanted to share my findings for anyone looking for something like this. need less to say, im not responsible for any data loss thats up to you to take the risk. 1) Create a share called "homes" (NOTE: with a 's')and set the export to "no" security to "Public and leave everything else to default 2) create a directory under "/mnt/user/appdata" called "home" (NOTE: without the 's') 3) goto the directory created in the last step ("/mnt/user/appdata/home") and create a file called "create_userdir.sh" and set permissions to 777 (there maybe a more secure way to allow this script to run but this worked for me). 4) open the file created in the last step ("create_userdir.sh") with a editor then copy, paste, save the code below #!/bin/sh USER="" if [ $# -gt 0 ]; then USER=$1 fi if [ $USER ]; then if getent passwd | grep -q "^$USER"":"; then if [ ! -d "/mnt/user/homes/$USER" ]; then mkdir -m 777 "/mnt/user/homes/$USER" chown $USER:100 "/mnt/user/homes/$USER" exit 0 else exit 0 fi else exit 1 fi else exit 1 fi 5) Mount your usb boot drive and open "/config/smb-extra.conf" then copy,paste,save the code below (make sure you paste the code AFTER anything thats already in that file. DO NOT delete/overwrite anything there) #Home_Start [home] comment = Home path = /mnt/user/homes/%U browsable = yes invalid users = guest writable = yes read list = "%U" write list = "%U" valid users = "%U" root preexec = /mnt/user/appdata/home/create_userdir.sh '%U' #Home_Stop 5b) when you done it should look something like this 6)reboot & profit you will see a new share called "home" Ok here the break down of what this do.... smb-extra.conf creates a dynamic share called "home" when a user trys to access the share "home" a script called 'create_userdir.sh' is ran what "create_userdir" do is, take the username that is trying to access this and check if there "private" directory already exist and if not create the directory (this is for when a new user is create and dont already have a "private" directory, its to make sure that the share "home" have a valid directory to be mounted to) smb-extra.conf then dynamically sets the path to what ever the current user "private" directory is. because of how the shares works per user. your only able to see YOUR "private" share. If an admin wants to make changes or delete some files thats not theirs they can go to "/mnt/user/homes/" to see all the users "private" directory. Hope this helps someone, and feel free to leave a reply if you need some help. Edited March 3, 2020 by Alacard Quote Link to comment
brokenworld Posted March 12, 2022 Share Posted March 12, 2022 @Alacard thanks for your effort! I am coming from a QNAP as well and Im quite surprised that this per-user "Home"-feature is neither implemented nor requested a lot by the community. Does your solution/script still work with latest Unraid 6.9.2 ? Quote Link to comment
Alacard Posted March 12, 2022 Author Share Posted March 12, 2022 yes, im currently running 6.10.0-rc3 and still working Quote Link to comment
Tomo82 Posted April 4, 2023 Share Posted April 4, 2023 Sorry to necro this semi-old thread - but I am also looking for and missing this feature. It would be great if this script or another could be implemented as a Plugin! So people can choose whether to have it or not and if enough people download it maybe it could be a built in option. @Alacard - are you still using this? If so, what version are you using? Thanks! Quote Link to comment
Alacard Posted April 7, 2023 Author Share Posted April 7, 2023 @Tomo82 sorry for the semi late reply, yes im still using it currently running 6.12.0-rc2 Quote Link to comment
Tomo82 Posted April 8, 2023 Share Posted April 8, 2023 @Alacard Thanks! I give it a go.... Quote Link to comment
sjac64 Posted September 3, 2023 Share Posted September 3, 2023 Hi, I've joined my server to an Active Directory Domain and i can't accessing the home share but i see it. I think there is something to add in the create script but i have no idea how. Can someone help, pls? Quote Link to comment
hernandito Posted September 13, 2023 Share Posted September 13, 2023 Just a thought... something better could be achieved w/ Nextcloud. You create your users, open internet access to it via Swag reverse proxy, and then your users have the equivalent of Dropbox. Quote Link to comment
ChristianHawkins Posted November 11, 2023 Share Posted November 11, 2023 I have followed your instructions and 95% of the time it works great. However, I have found, that if my Hard Drive spins down, all the folders in my home folder become unaccessible in OSX. I have no idea why. I have to completely disconnect from all shares and reconnect. Does someone have similar issues and/or a solution? Quote Link to comment
frimu Posted February 24 Share Posted February 24 (edited) I just started with Unraid 6.12.6 and generated users and for each user a share with the name of the share identical to the <username> of each user. Additionally I generated a share called "homes" (with s). Then i connected on my Windows machine to \\<SERVERIP>\homes and i was surprisingly connected with my own <username> share. This looked on the beginning very strange to me but is possibly the "inbuilt" solution which the users in this thread were looking for. I am sure that I was connected with my own "username" share because there was already data stored while the share "homes" which I manually generated was still empty. So I made the share "homes" invisible for SMB again and was still able to connect from my Windows machine to \\<SERVERIP>\homes but again I was connected with my own share <username>. to summarize: 1.) generate for every username one usershare and use exactly the same name for share and username 2.) each user connects via SMB to \\SERVERNAME\homes and each user will be connected to it's own share that's it. Unfortunately this feature (or bug?) seems not to be found in the official UNRAID documentation. I searched for "homes" and found nothing explainting this observed behaviour Edited February 24 by frimu Quote Link to comment
itimpi Posted February 24 Share Posted February 24 Never heard of this behaviour before! I think a bit more digging into why you get it needs doing, although I am not sure what the next steps are at the moment. Maybe if you attach your system’s diagnostics zip file to your next post in this thread it might give a clue. it is always a good idea when asking questions to supply your diagnostics so we can see details of your system, how you have things configured, and the current syslog. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.