Sometimes, you might want to access your Linux files from your Android/iOS devices without using a USB or any wired medium. Network sharing is a really easy way of sharing files, folders, or entire drives across devices on the same network. But once you set up network sharing, you also need to know how to access those files.

Let’s learn how to access your Linux files on Android and iOS with a network share.

sharing linux files on the network

What Is Network File Sharing?

When you want to share a file or folder with someone, sometimes it is faster to share it over your local network, rather than uploading to the cloud or looking for a USB flash drive. This process is called network file sharing.

Setting up a File Transfer Protocol (FTP) serveris also a valid option for file sharing remotely or on the local network, but it’s much more of a hassle to set up than a network share.

Accessing Linux Files

Linux implements network sharing with Samba. It is a file-sharing service that implements open-source versions of the SMB suite of protocols, which was originally developed by Microsoft and IBM.

The Server Message Block (SMB) protocol is a network file-sharing protocol that allows computers to share files, printers, and other resources over a network. SMB facilitates authentication, access to shared resources, and file operations between clients and servers.

Select connect with SMB

Set Up Network File Sharing on Linux

To start network sharing on Linux, you’ll need to install and set up the Samba service. You can use the default package manager of your Linux distribution to install Samba.

On Ubuntu/Debian derivatives, use:

On Arch-based systems, run:

On Fedora, CentOS, and Red Hat Enterprise Linux, run:

Simply installing it is not enough, you’ll need to configure Samba properly to set up and access shareable drives and folders on your Linux system.

Input login credentials

It’s recommended you go through this walkthrough ofhow to install and configure Samba on Linux.

SMB is a protocol that’s prone to vulnerabilities and Samba servers are a lucrative target for threat actors. Once you’ve set your Samba server up, it’s worth knowing thebest ways to secure your Samba serverfrom cyber-attacks.

Select connect to server

How to Access Network-Shared Linux Files From Android

Now that you have set up Samba and created a shared network drive, you need to connect your Android phone to the same network as your Linux system or vice versa. Once they’re both on the same network, follow these steps to share files across Android and Linux:

How to Access Network-Shared Linux Files From iOS

The steps to access Linux files from iOS are identical to the steps required to access Linux from Android devices.

First, grab the IPv4 address of your Linux system. To do so, fire up a new terminal and type inifconfig. It should return output related to the network settings of your Linux system. From the output note down the IPv4 address in theinetfield. It will most probably be something like “192.168.1.10”.

In case you face an “ifconfig command not found” error, you can also use theip acommand as an alternative. Once you have the IPv4 address of your Linux system hosting the drive, follow these next steps to connect to it from your iOS device:

Now you should be able to view the files on the shared drive. you may now download, upload, or modify the local files on your Linux system with ease.

Access Your Linux Files From Android/iOS With Samba

Now that you know how to access your Linux files using Samba, uploading, downloading, and modifying files should be super easy to do. Now you won’t have to rely on downloading and testing third-party applications for minor tasks like copying PDF files from your Linux to your Android/iOS devices.

Samba servers are common targets of adversaries, so tread with caution should you choose to permanently keep the server up and running. It’s highly recommended you follow the security best practices and make the required configuration to avoid unsolicited access or system compromise.

Moreover, if you wish to share files between computers on the same network, that is possible as well. But for heavy file sharing between two computers, it’s better if you try out other, more secure, and efficient alternatives to network sharing.