Mostrando entradas con la etiqueta Folders. Mostrar todas las entradas
Mostrando entradas con la etiqueta Folders. Mostrar todas las entradas

sábado, 10 de octubre de 2020

LINUX. SAMBA Server. Share external disk

 



Purpose

Configure Samba server with external hard disk in Linux machine permanently.

I have 2 usb hardisk in a one rapberrypi with samba server and ubuntu operating system. I want share this hard disk in my network permanently


Steps

[FIRST PART]  - Mount disk permanently


COMMAND: sudo fdisk -l

List all disk


COMMAND: mkdir

We need to create 2 folders to mount each external disk, one for each disk

COMMAND: chmod

We need apply security folder permissions


COMMAND: blkid

Verify the unique identifier of disk.


In order mantain this share configuration at the next boot, we need modify the fstab file

COMMAND: sudo cp /etc/fstab /etc/fstab.old

Backup file configutartion


COMMAND: sudo nano /etc/fstab


COMMAND:  sudo umount -a

Dismount and mount discks


COMMAND:  ls 

Check the mount disk


COMMAND:  sudo reboot

Now, you can reboot the computer to verify if it is permanent this configuration



[SECOND PART] Share disk in Network


Share this folders to network

REF: https://gonsystem.blogspot.com/2020/09/linux-samba-server-ubuntu.html

COMMAND: sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old2

Backup file configutartion

COMMAND: sudo nano /etc/samba/smb.conf

Modify the configuration file, add next text

COMMAND: testparm

Check parameters


COMMAND: sudo systemctl restart smbd  
COMMAND: sudo service smbd restart     

Restart samba service


[PART THREE] Check at client


 Check from Windows Client



To map in windows


To map in Linux:

 REF: https://gonsystem.blogspot.com/2020/05/linux-samba-client-basic-configuration.html

Check at Linux Ubuntu 4.11.6
by GoN | Published: Oct 10 , 2020 | Last Updated:

domingo, 27 de septiembre de 2020

LINUX. SAMBA Server - UBUNTU




Purpose

How to Install Samba server to share files. I want create a NAS for share files for Backups or films server ;-)

Use a Raspberri Pi 4 connect some HD docks stations.

Steps

[ ] Check Operating System version

COMMAND: smbd --version

 

[ ] Update Operating System

COMMAND: sudo apt-get update

COMMAND: sudo apt-get upgrade

 [ ] Install Samba System

COMMAND: sudo apt install samba

[ ] Where is install SAMBA system?

COMMAND:  sudo systemctl status smbd


[ ] Check Samba System Status

COMMAND:  sudo systemctl status smbd


If the service it's running you can start with

COMMAND:  sudo systemctl start smbd && sudo systemctl enable smbd

 [ ] Backup current configuration

COMMAND:  sudo cp -rfvp /etc/samba/smb.conf /etc/samba/smb.conf-back



[ ] New GROUP (gonsmbgrp) Only for secure accesss.

COMMAND:  sudo addgroup gonsmbgrp 

[ ] New USER (gonsambausr). Only for secure access.

COMMAND:  sudo useradd gonsambausr -m -G gonsmbgrp

COMMAND:  sudo passwd gonsambausr

COMMAND:  sudo smbpasswd -a gonsambausr


 [ ] Create folder to share ( /media/EXTHD01). No secure access. All access.

COMMAND: 

sudo mkdir /media/EXTHD01

sudo chmod -R 777 /media/EXTHD01

sudo chown -R nobody:nogroup /media/EXTHD01

[ ] Create folder to share ( /media/EXTHD02). Secure. User and Password.

 COMMAND: 

sudo mkdir /media/EXTHD02

sudo chmod -R 777 /media/EXTHD02

sudo chown -R  gonsambausr:gonsmbgrp /media/EXTHD02

sudo chmod -R  777 /media/EXTHD02


 [ ] Configure SAMBA

 COMMAND: sudo nano/etc/samba/smb.conf

* Anonymous Access

[sambagonshareanonimo]

comment = ShareGoN

path = /media/EXTHD01

read only = no

browseable = yes

guest ok = yes

force user = nobody



* Secure Access

[Sambaseguro]

comment = ShareGoNSeguro

path = /media/EXTHD02

browseable = yes

writable = yes

browsable = yes

valid users = gonsambausr @gonsmbgrp

read only = no


[ ] Check Params

 COMMAND: testparm


/********************************************************************/

gon@gon-desktop:/media$ testparm

Load smb config files from /etc/samba/smb.conf

Loaded services file OK.

Server role: ROLE_STANDALONE

 

Press enter to see a dump of your service definitions

 

# Global parameters

[global]

        log file = /var/log/samba/log.%m

        logging = file

        map to guest = Bad User

        max log size = 1000

        obey pam restrictions = Yes

        pam password change = Yes

        panic action = /usr/share/samba/panic-action %d

        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

        passwd program = /usr/bin/passwd %u

        server role = standalone server

        server string = %h server (Samba, Ubuntu)

        unix password sync = Yes

        usershare allow guests = Yes

        idmap config * : backend = tdb

 

 [printers]

        browseable = No

        comment = All Printers

        create mask = 0700

        path = /var/spool/samba

        printable = Yes

 

 [print$]

        comment = Printer Drivers

        path = /var/lib/samba/printers

 

 [sambagonshare]

        comment = ShareGoN

        force user = nobody

        guest ok = Yes

        path = /media/EXTHD01

        read only = No

 

[Sambaseguro]

        comment = ShareGoNSeguro

        path = /media/EXTHD02

        read only = No

        valid users = gonsambausr @gonsmbgrp

gon@gon-desktop:/media$

/********************************************************************/


[ ] Firewall permit rule

 COMMAND: sudo ufw allow samba

 

[ ] Restart Samba services to effect the above changes.

COMMAND:
sudo systemctl restart smbd  

sudo service smbd restart   


 [ ] Check from windows System

COMMAND: \\IP

For Example \\192.16721.33


[ ] Links:


Check at Linux Ubuntu 4.11.6
by GoN | Published: Sept , 2020 | Last Updated:

miércoles, 20 de mayo de 2020

WINDOWS AND LINUX. Folder access problems share and local. folder is not available. If the location is on this computer


Purpose


Acces a folder created and share in a linux server fron a Windows system (local and net)

Explanation


I share a HD with NTFS format from Linux samba to Windows Clients. When the Windows clients try access some folders have access errors, if I try connect with a Linux client I don't have problmes.

I have gone crazy until I have found a pattern and I have solved it, it has taken me several days to test.


English msg error:


"not available. If the location is on this computer, make sure the device or drive is connected or the disc is inserted, and try again. If the location is on a network, make sure it is connected to the network or the Internet, and then try again. If you still can't find the location, it might have been moved or removed."

Spanish msg error:


" no está disponible. Si la ubicación está en este equipo, asegúrese de que el dispositivo o la unidad esté conectado o que el disco esté insertado, e inténtelo de nuevo. Si la ubicación está en una red, asegúrese de que esté conectado a la red o a Internet, y después inténtelo de nuevo. Si aún así no encuentra la ubicación, esta podría haberse movido o eliminado."


Solution: Rename the folder name WITHOUT dot "." at the end from linux system


by GoN | Published: May 20, 2020 | Last Updated: