This article will describe how to install samba and access to home directory and share directory from Windows 10. IP address of samba server is 192.168.11.67.
Table of Contents
1 Install samba
samba is already installed by default but not enabled.
> sudo zypper -n in samba # If you have uninstalled samba. > sudo systemctl enable smb nmb > sudo systemctl start smb nmb
2 Port
Open port with config file "samba-server".
> firewall_open_service() { for t in FW_CONFIGURATIONS_EXT FW_CONFIGURATIONS_DMZ FW_CONFIGURATIONS_INT; do sudo sed -e "s/^${t}=\"\(.*\)\"/${t}=\"\1 $1\"/g" \ -i /etc/sysconfig/SuSEfirewall2 done sudo systemctl restart SuSEfirewall2 } > firewall_open_service samba-server
3 pdbedit
Add user access to samba with pdbedit.
> sudo pdbedit -a hiroom2 new password: retype new password:
4 /etc/samba/smb.conf
Home directory sharing is enabled by default. The following will enable share directory with multiple user.
> diff -uprN /etc/samba/smb.conf{.org,} --- /etc/samba/smb.conf.org 2016-12-29 00:38:07.350937431 +0900 +++ /etc/samba/smb.conf 2016-12-29 00:50:14.156559064 +0900 @@ -51,3 +51,10 @@ force group = ntadmin create mask = 0664 directory mask = 0775 + +[share] + comment = Share directory + path = /var/lib/share + read only = no + guest only = no + guest ok = no
Create share directory.
> sudo mkdir /var/lib/share > sudo chmod 0777 /var/lib/share
Restart samba.
> sudo systemctl restart smb nmb
5 Access to samba from Windows 10
Below URL on explore will access to home directory.
\\192.168.11.67\hiroom2
Below URL on explore will access to share directory.
\\192.168.11.67\share
You can use "Map Network drive" to samba.