Constantly jumping between my home desktop and work laptop, working on the same projects require frequent git push/pull. For every small edit, I have to git everything to keep my workspaces up to date.
Another tedious task was to developp directly on my RPI. Coding on nano throught a SSH connection is not something I would call a comfy dev environnement. ๐โโ๏ธ
Basically, what I need is just a NAS... wright?
Yeah! This could do the trick ๐ I could even use it to share movies across my phone and PC ๐ and to host a database (a MongoDB to be more precise). Terrific!
โWhy don't you just buy a Synology NAS? You can even put database on this bad boy!โ
Ooohhh, come on! Where can I have fun if I buy an all in one box ๐ I mean, a Synlogy NAS despite all its features will always stay less flexible than a RPI. I still need it to run all my sketchy websites and other quirky node projects ๐งช.
Just keep in head that I'm a Windows user so my options are kinda limited...
A first google search lead me to Samba. It's free, both Windows and Unix compatible and do not seems overly complicated to configure.
apt install samba
cp /etc/samba/smb.conf /etc/samba/smb.conf.sample
service smbd start
Well, that was easy! Install, duplicate default config file (a good habit everyone should have ๐โโ๏ธ) and run the thingy.
Unix and Window file system and permissions DO NOT work the same. Samba take care 'natively' of the file system aspect but it needs some extra tweaking for permissions.
Power user know how Windows permissions can be a real nightmare sometimes ๐ฅ
After speding a lot of time messing if different config sample found on blog,forum,... I finally come up with a working one ๐
[share]
comment=Workplace
path=/home/pi/work/
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
public=no
As we set public=no
, we need to create a samba user to be able to log in ๐
sudo smbpasswd -a pi
This command will create a user named pi
and allow you to set a password for it.
What's great about Samba is that it's natively supported by Windows.
Open the Windows explorer and just write down the server IP address like following \\192.168.1.101
.
A small window should appear asking you login informations.
This only works for local network. In order to connect from everywhere you need to tweak your router config to forward port 445
to your server.
To connect from any Android phone you can use CS File Explorer ๐
And we're done! ๐
Coming soon