Ubuntu 20.04 best way to make file server?

I have recently read somewhere that you can simply host a file server with '''python3 -m http.server'''. I plan on using this on a PC running Ubuntu and access using my laptop so I don't have to have all my files on my laptop. Is this the best way to do it? I have seen many others using Apache, Samba and such. I just want to know which would be easiest to just access a few files.

7

3 Answers

Install samba apt install samba samba-common-bin it is so simple to do too, edit one file, set password, restart daemon and your done. The nano /etc/samba/smb.conf in the [homes] section change the yes to no like below to have the share read/writable, at the bottom of the file add your share. Then set the password for the user_name you want to be able to access the share with smbpasswd -a user_name and restart samba service smbd restart. All commands run with sudo in front of them in the Terminal application.

 # By default, the home directories are exported read-only. Change the # next parameter to 'no' if you want to be able to write to them.
read only = no
snip ....
[share-name]
path = /home/user_name/share_directory
writeable=Yes
create mask=0777
directory mask=0777
public=no

You do not mention if this is local network only access, I would hope so securing server against the bots that scan the internet 24/7 is next to impossible for a normal user.

Here's one way.

Walk before you run. Start with exchanging files over ssh.

  1. Look up how to set up ssh keys on your client and server for secure, passwordless login.

    • Pro Tip: NEVER trust password logins on the dirty, dirty internet. ALWAYS use keys.
  2. Look up how to set up DDNS so you can locate your server from a remote location.

  3. Now you are ready to upload and download files using the scp command. It's included with ssh, so nothing new to install.

  4. Use 'sshfs' with your File Manager. Nautilus handles sshfs automatically -- it's part of the 'connect to server' feature. Windows plug-ins for sshfs are available.

  5. Create a backup plan. Internet-connected servers get compromised. Hardware dies. Humans make typos that erase their data. If you data is worth all the effort to serve, then it's worth backing up regularly. Most trustworthy network backups are done over ssh.

1

Yes, python3 -m http.server is the most convenient way if you would like to download files remotely. No configurations needed.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like