How to create a network share via Samba using the Command-line interface/Linux Terminal, simple and brief way targeting Windows users.
3. Create a directory to be shared
Make sure you take a safe backup copy of the original /etc/samba/smb.conf file to your home folder, in case you make an error
Edit the file "/etc/samba/smb.conf"
1. Install Samba
sudo apt-get update sudo apt-get install samba
$ add user <username>
$ sudo smbpasswd -a <user_name>
$ mkdir /var/www/html/<folder_name>
$ sudo cp /etc/samba/smb.conf ~
$ sudo nano /etc/samba/smb.conf
Add the folder access right to user access from another pc/window and can guest also[<folder name>] comment = admin access path = /var/www/html/<folder path> browsable = yes guest ok = no writable = yes valid users = @<user name> create mask = 664 force create mode = 664 security mask = 664 force security mode = 664 directory mask = 2775 force directory mode = 2775 directory security mask = 2775 force directory security mode = 2775
Restart the Server
$ sudo service smbd restart
OR command for restart
save file and close.
Now, run in the browser
share directory access from linux
$ sudo systemctl restart smbd.service
$ sudo systemctl restart nmbd.service
To access your network share Make a Static IP address for this server to access from another pc using router or in pc from url with register url in your /etc/hosts file
localhost <HOST_IP_OR_NAME>
save file and close.
Now, run in the browser
https://<HOST_IP_OR_NAME>/<folder_name>
share directory access from linux
smb://<HOST_IP_OR_NAME>share directory access from window in file manager
In filemanager in your another pc window or linux
\\<HOST_IP>
\\192.11.11.1\test
No comments:
Post a Comment