当前位置:网站首页>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 .
边栏推荐
- . Net cloud native architect training camp (permission system code implements actionaccess) -- learning notes
- The new server is packaged with the source code of H5 mall with an operation level value of several thousand
- People help ant help task platform repair source code
- Reflective XSS vulnerability
- Redis master-slave realizes 10 second check and recovery
- DNS
- 期货先锋这个软件正规吗安全吗?选择哪家期货公司更安全?
- ACL 2022 | decomposed meta learning small sample named entity recognition
- 股票万1免5证券开户是合理安全的吗,怎么讲
- EasyCVR设备录像出现无法播放现象的问题修复
猜你喜欢
Kia recalls some K3 new energy with potential safety hazards
Nearly 60% of the employees strongly support Ctrip's "3+2" working mode, and work at home for two days a week
[Verilog quick start of Niuke network question brushing series] ~ priority encoder circuit ①
Petrv2: a unified framework for 3D perception of multi camera images
Technical secrets of ByteDance data platform: implementation and optimization of complex query based on Clickhouse
New 95 community system whole station source code
Apache iceberg source code analysis: schema evolution
Htt [ripro network disk link detection plug-in] currently supports four common network disks
Sword finger offer 20 String representing numeric value
DNS
随机推荐
Intel's open source deep learning tool library openvino will increase cooperation with local software and hardware parties and continue to open
网上股票开户安全吗?是否可靠?
Debiasing word embeddings | talking about word embedding and deviation removal # yyds dry goods inventory #
MySQL + JSON = King fried
(十六)ADC转换实验
June issue | antdb database participated in the preparation of the "Database Development Research Report" and appeared on the list of information technology and entrepreneurship industries
Apache iceberg source code analysis: schema evolution
C language implementation of sum of two numbers [easy to understand]
官宣!香港科技大学(广州)获批!
D @ safety and dip1000
Radhat builds intranet Yum source server
EasyCVR通过国标GB28181协议接入设备,出现设备自动拉流是什么原因?
Openlayers customize bubble boxes and navigate to bubble boxes
[Verilog quick start of Niuke network question brushing series] ~ priority encoder circuit ①
Unity3d extended toolbar
PHP实现敏感词过滤系统「建议收藏」
Explain in detail the process of realizing Chinese text classification by CNN
Rotation order and universal lock of unity panel
Penetration practice vulnhub range Nemesis
[splishsplash] about how to receive / display user parameters, MVC mode and genparam on GUI and JSON