1. Linux server and windows client
On Linux server:
1. install samba:
>sudo apt install samba
2. add samba user:
>sudo smbpasswd -a username
attention: username should be the user of Linux server. You can't create a new one here.
3. configure samba:
>vi /etc/samba/smb.conf
[share]
comment = share folder
browseable = yes
path = /your share folder on Linux server
create mask = 0777
directory mask = 0777
valid users = username of user of Linux server
force user = nobody
force group = nogroup
public = yes
available = yes
Attention: modify share folder as >sudo chmod -R go+wrx /your share folder. Or may has write permission issue.
4. restart samba server:
>/etc/init.d/smbd restart
On Windows client:
client can access the linux server now by:
\\linux-server-ip
2. Windows server and Linux client
On Windows 10:
1. enable SMB server on control pane->programs and features->Turn Windows features on or off->SMB*
2. share one folder
On Linux:
1. install samba client
>sudo apt install smbclient
2. install cifs
>sudo apt install cifs*
3. check windows server
>sudo smbclient -L //10.25.132.119 -U windows domain name/your username
Attention: windows use domain/user mode to login, so here -U should followed by domain/user mode.
Here is the result:
Domain=[my domain] OS=[Windows 10 Enterprise 16299] Server=[Windows 10 Enterprise 6.3]
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
IPC$ IPC Remote IPC
smbtest Disk
Domain=[my domain] OS=[Windows 10 Enterprise 16299] Server=[Windows 10 Enterprise 6.3]
Server Comment
--------- -------
Workgroup Master
--------- -------
4. access the server by smbclient
>sudo smbclient //10.25.132.119/smbtest -U windows domain name/your username
Attention:smbtest is the share folder on Windows.
here is the result:
Domain=[my domain] OS=[Windows 10 Enterprise 16299] Server=[Windows 10 Enterprise 6.3]
smb: \> ls
. D 0 Thu Dec 27 12:28:06 2018
.. D 0 Thu Dec 27 12:28:06 2018
tets.txt A 18 Thu Dec 27 12:28:06 2018
241588991 blocks of size 4096. 230191336 blocks available
smb: \>
at "smb: \> " , we can use commands such as get , put as ftp.
5. mount share folder to /mnt
>sudo mkdir /mnt/pxa
>sudo mount -t cifs -o user=username,vers=1.0 //10.25.132.119/smbtest /mnt/pxa
Attention:
Here don't need windows domain name. Strange.
vers=1.0 could be 2.0, 3.0