当前位置:网站首页>Samba basic usage
Samba basic usage
2022-07-01 17:56:00 【yuyuyuliang00】
Program environment :
Server package :samba And Windows Server and client software for machine interaction .
The configuration file :/etc/samba/smb.conf from samba-common Package supply
The main program :
nmbd: NetBIOS Name server
smbd:SMB/CIFS The server
unit :
smb.service
nmb.service
Listening port :
137/udp 138/udp
139/tcp 445/tcp
Prepare three computers :
proxy:192.168.10.107 192.168.200.2(samba Server side )
web02:192.168.200.2 ( client )
windows 10:192.168.10.106( client )
Install the software :yum install samba
Check the software :rpm -q samba
After the software is installed, the /etc/samba Create... In the directory 3 File :lmhosts smb.conf smb.conf.example
# cp smb.conf{,.bak}
# mv smb.conf.example smb.conf
Master profile :/etc/samba/smb.conf, There are the following descriptions :
The configuration section of the main configuration file that needs to be modified :
workgroup = SAMBA # workgroup = windows NT Domain name or workgroup name , for example :SAMBA
server string = Samba Server Version %v # server string = amount to Windows NT Description segment
netbios name = Proxy # netbios name = Used to specify a server name that is not bound to this hostname , most 15 Characters .
interfaces = lo eth0 eth1 # interfaces = Used for configuration Samba Monitor multiple network interfaces . If you have multiple network cards , You can use "interfaces =" Options to configure Samba Monitor which of those network cards . Don't miss the local interface (lo).
hosts allow = 127. 192.168.10. 192.168.200. # hosts allow = Hosts allowed to connect . You can also use this option for each machine .
Test whether the parameters are correct :testparm

Add... On the server side samba Account and add this user and set access samba Activate after password :
useradd smbuser1
smbpasswd -a smbuser1
smbpasswd -e smbuser1
execute :systemctl start smb
client :
install cifs-utils Software , Support cifs File system and samba-client
Client program :
smbclient: Interactive command line client
mount.cifs: mount cifs Special commands for the file system
On the client side web02 Installation on samba Client software :
yum install samba-client
yum install cifs-utils
Add... On the server side samba Account and add this user and set access samba Activate after password :
useradd smbuser1
smbpasswd -a smbuser1
smbpasswd -e smbuser1
On the client side web02: smbclient -L 192.168.200.2 -U smbuser1 And enter the set password , You can see Samba Content exported from the server :

Use on client web02 On , use smbclient Test the upload and download services of the server :
smbclient //192.168.200.2/homes -U smbuser1

ls Display the contents of the server directory ,!ls Display the contents under the local path ,get Download the file from the server to the current path ,put Upload files from the current path to the server .
stay web02 client , mount samba Servers share content :
temporary :
mount -t cifs -o user=smbuser,pass=xxxxx //192.168.200.2/homes /mnt/smb

Be careful :
df -h View the mount
ls /mnt/smb View the content shared by the server
permanent :
stay fstab Write the following content to mount samba Servers share content :
//192.168.200.2/homes /mnt/smb cifs defaults,_netdev,user=smbuser1,pass=xxxxxx 0 0
stay windows client , By mapping the network drive , Fill in the service address :

Then fill in the user name and password :

The content shared by the server can be displayed on the client :

Be careful : Be sure to turn off the firewall on the server , Or use policy to release the specified port , Otherwise, the client will report permission error .
边栏推荐
- 传感器尺寸、像素、DPI分辨率、英寸、毫米的关系
- Rotation order and universal lock of unity panel
- How to write good code - Defensive Programming Guide
- Yolov5 practice: teach object detection by hand
- Function, condition, regular expression
- Penetration practice vulnhub range Tornado
- [splishsplash] about how to receive / display user parameters, MVC mode and genparam on GUI and JSON
- 手机开户股票开户安全吗?那么开户需要带些什么?
- Integer array merge [JS]
- L'ouverture d'un compte d'actions en ligne est - elle sécurisée? Fiable?
猜你喜欢

Heavy disclosure! Hundreds of important information systems have been invaded, and the host has become a key attack target

Setting up a time server requires the client to automatically synchronize the time of the server at 9 a.m. every day

Countdownlatch blocking wait for multithreading concurrency

Vulnhub range hacksudo Thor
![[PHP foundation] realize the connection between PHP and SQL database](/img/eb/c8953eddfe3b19b0adb5529957d275.jpg)
[PHP foundation] realize the connection between PHP and SQL database

Kernel stray cat stray dog pet adoption platform H5 source code

Good looking UI mall source code has been scanned, no back door, no encryption

Debiasing word embeddings | talking about word embedding and deviation removal # yyds dry goods inventory #

Euler function: find the number of numbers less than or equal to N and coprime with n

An example of data analysis of an old swatch and an old hard disk disassembly and assembly combined with the sensor of an electromagnetic press
随机推荐
(16) ADC conversion experiment
DRF --- response rewrite
Roewe rx5's "a little more" product strategy
Depth first traversal and breadth first traversal [easy to understand]
PHP实现敏感词过滤系统「建议收藏」
Setting up a time server requires the client to automatically synchronize the time of the server at 9 a.m. every day
JDBC: deep understanding of Preparedstatement and statement[easy to understand]
徽商期货是正规期货平台吗?在徽商期货开户安全吗?
Pyqt5, draw a histogram on the control
Enter wechat applet
Debiasing word embeddings | talking about word embedding and deviation removal # yyds dry goods inventory #
Integer array merge [JS]
Yolov5 practice: teach object detection by hand
ACL 2022 | decomposed meta learning small sample named entity recognition
EasyCVR设备录像出现无法播放现象的问题修复
SPIE Western optoelectronics exhibition returned offline and successfully held a science and engineering event
In depth Research Report on China's disposable sanitary products production equipment industry (2022 Edition)
Countdownlatch blocking wait for multithreading concurrency
Relationship between sensor size, pixel, dpi resolution, inch and millimeter
目前炒期货在哪里开户最正规安全?怎么期货开户?