In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to build a samba server in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Use the centos6.8 installed by the vmware12 virtual machine and the windows10 on the physical machine to access the samba service on the CentOs on the windows10.
First, check whether the software package related to samba service is installed in the system.
Check that there are no samba-related packages installed in my linux, and then install several related packages:
Samba-3.6.9-151.el6.x86_64 / / server-side software, which mainly provides daemon of samba server, rotation of shared documents and logs
Samba-common-3.6.9-151.el6.x86_64 / / mainly provides the samba server settings file and settings file syntax checker testparm
Samba-client-3.6.9-151.el6.x86_64 / / client software, which mainly provides the set of tool instructions needed when the linux host is used as the client
Second, use yum to install packages (this can solve the dependency between packages), of course, you can also use rpm to install individually
Check that the installation has been successful (the extra ones are due to dependency installations)
After a successful installation, the system generates a configuration file for the service and some command tools
/ etc/samba/smb.conf / / is the main configuration file for the samba service / etc/init.d/smb / / is the startup / shutdown file for samba
Third, check the startup of the service and set the service to start automatically.
# service smb status
# service smb start
Set the boot to start automatically
# chkconfig-- level 35 smb on
4. Modify the smb service configuration file
[global] / / set the overall environment for samba services
Workgroup = WORKGROUP / / set workgroup name
Server string = Samba Server Version% v / / server description
[laiGei] / / name of the shared directory
Comment = Public stuff / / comment description
Path = / usr/local/laige / / path to the shared directory
Public = yes/ / is yes/ No no public sharing, otherwise authenticate (this only works when security = share)
Writeable = yes/ / is yes/ No no is not shared read-only when there is a conflict with read only, ignore read only
Browseable = yes/ / is yes/ No no displays the shared directory in browsing resources. If so, you must specify a shared path to access it.
Guest ok = yes/ / is yes/ No no public sharing, otherwise authenticate (this only works when security = share)
The path to the shared directory is / usr/local/laige, and the external name is laiGe
After the configuration file has been modified, restart the service
# service smb restart
Add a shared user to access shared files
Add a normal user first (because the shared user to be added must be a system user)
# useradd laige / / because you don't need to log in to shell, you don't have to set a password
Then use smbpasswd to add the shared user and set the password
# smbpasswd-a laige
Use windows to access the samba server in linux (in the case of network interconnection)
Check linux's ip first.
# ifconfig eth0
Ip is 192.168.1.194
Then turn off the firewall.
# service iptables stop
Finally, open the File Explorer in windows and enter\\ 192.168.1.194 to access it.
Enter the shared user name and password for access
Successfully accessed the samba server on linux on windows10.
Ps: there are a few things you just need to pay attention to:
1. The firewall should be turned off, # service iptables stop
2. Selinux should be set to disabled, and the path is / etc/sysconfig/selinux
3. Pay attention to the permission settings of the shared directory
4. To set up direct access without a username and password, you need to modify the configuration file to set security to security = share.
Common ways to add shared users using smbpasswd:
Smbpasswd-an add user (the added user must be a system user)
Smbpasswd-d freezes users (this user is no longer available)
Smbpasswd-e restore users (unfreeze frozen users)
Smbpasswd-n sets the user password to empty
Smbpasswd-x Delete user
These are all the contents of the article "how to build a samba server in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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: 223
*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.