In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about how to use samba shared folders in CentOS 7. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
Install samba
Yum install-y samba
Create a samba user
Useradd samba
Modify samba configuration
The configuration file is / etc/samba/smb.conf
# See smb.conf.example for a more detailed config file or# read the smb.conf manpage.# Run 'testparm' to verify the config is correct after# you modified it. [global] workgroup = SAMBA # samba workgroup, set to Windows workgroup security = user # security option, which can be share | user | server | domain Security level increment passdb backend = tdbsam printing = cups printcap name = cups load printers = yes cups options = raw [homes] # share will share the user's home directory by default, which is not secure and can be annotated comment = Home Directories valid users =% S % D%w%S browseable = No read only = No inherit acls = Yes [printers] # Printer share comment = All Printers path = / var/tmp printable = Yes create mask = 0600 browseable = No [print$] comment = Printer Drivers path = / var/lib/samba/drivers write list = root create mask = 0664 directory mask = 0775 [rootdir] # Custom shared folder comment = SambaRoot path = / home/samba/ # path to share read only = No
Note that the comment after # is removed when you modify it.
Add Samba user
Add the samba user you just created and set the corresponding password according to the prompts
Smbpasswd-a samba
The smbpasswd command is used to maintain the user account of the Samba server, as follows:
/ / add Samba user account # smbpasswd-a sambauser// disable Samba user account # smbpasswd-d sambauser// enable Samba user account # smbpasswd-e sambauser// delete Samba user account # smbpasswd-x sambauser
Start the Samba service
Start, stop, view related commands
Systemctl start smbsystemctl stop smbsystemctl status smb
Windows accesses a shared directory
Directly Win + R, enter\ 192.168.1.20 in the runtime interface, that is, your Linux host address, will pop up the user name and password input interface, enter the user name and password just set to access.
common problem
If you access the shared directory under Linux under Windows, you will be prompted that you have no permission.
Make sure the firewall is turned off or the permissions of the shared directory are opened under Linux.
Make sure there is no problem with the Samba server profile smb.conf settings
Ensure that setlinux is turned off and can be executed with the setenforce 0 command; the default SELinux prohibits writing to shared directories on Samba servers on the network
Samb also needs to open the following four ports
UDP 137, UDP 138, TCP 139and TCP 445The above is how to use samba to share folders in CentOS 7. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.