To set up your Fedora laptop as a NAS (Network Attached Storage), you need to configure the permissions and install the necessary software to share your disk over the network. Below are the steps and commands you'll need:
### 1. Set Up Disk Permissions
First, let's ensure that the MavNas partition has the correct permissions. Assuming you want everyone on the network to have read/write access:
```bash
sudo chmod -R 777 /run/media/maverick/MavNas/
```
This command recursively sets read, write, and execute permissions for all users on the MavNas partition.
### 2. Install Samba
Samba is a software suite that provides file and print services to SMB/CIFS clients, allowing you to share files with Windows, macOS, and other Linux systems.
1. Install Samba:
```bash
sudo dnf install samba samba-common samba-client -y
```
2. Enable and start the Samba services:
```bash
sudo systemctl enable smb
sudo systemctl start smb
sudo systemctl enable nmb
sudo systemctl start nmb
```
### 3. Configure Samba
1. Backup the original Samba configuration file:
```bash
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
```
2. Edit the Samba configuration file:
```bash
sudo nano /etc/samba/smb.conf
```
3. Add the following configuration at the end of the file:
```ini
[MavNas]
path = /run/media/maverick/MavNas/
browsable = yes
writable = yes
guest ok = yes
read only = no
force user = maverick
```
This configuration will share the MavNas partition over the network, making it writable and accessible without requiring a password.
### 4. Set Samba Password for the User (Optional)
If you want to secure the share with a password, you can create a Samba password for your user:
```bash
sudo smbpasswd -a maverick
```
Follow the prompts to set the password.
### 5. Restart Samba Services
After making changes to the configuration file, restart the Samba services:
```bash
sudo systemctl restart smb
sudo systemctl restart nmb
```
### 6. Configure Firewall
If you have a firewall enabled, you need to allow Samba traffic through it:
```bash
sudo firewall-cmd --permanent --zone=public --add-service=samba
sudo firewall-cmd --reload
```
### 7. Access the Share
Now, you should be able to access the share from any computer on your network. On a Windows machine, you can open File Explorer and type `\\<Your_Fedora_IP_Address>\MavNas` in the address bar.
On another Linux machine, you can use a file manager to connect to the share or use the command line:
```bash
smbclient //Your_Fedora_IP_Address/MavNas -U maverick
```
Or, mount the share:
```bash
sudo mount -t cifs //Your_Fedora_IP_Address/MavNas /mnt -o username=maverick
```
Replace `Your_Fedora_IP_Address` with the actual IP address of your Fedora machine.
With these steps, your Fedora laptop should now be configured as a NAS, sharing the MavNas partition over your network.
Comments
Post a Comment