In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to deploy Samba services under Linux. I hope you will get something after reading this article. Let's discuss it together.
Samba is a free software that implements SMB protocol on Linux and UNIX systems, which is composed of server and client programs. SMB (Server Messages Block, Information Service Block) is a communication protocol for sharing files and printers on the LAN. It provides sharing services for files, printers and other resources between different computers in the LAN.
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
Fourth, 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 / / Note path = / usr/local/laige / / the path to the shared directory public = yes/ / is yes/ No no Public share Authenticate if otherwise (this only works if security = share) writeable = yes/ / is yes/ No no is not shared read-only when there is a conflict with read only, ignore read onlybrowseable = yes/ / Yes yes/ No no display the shared directory in browsing resources If otherwise, you must specify a share path to access guest ok = yes/ / is yes/ No no public share, if it is 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 to set disabled selinux, the path is / etc/sysconfig/selinux
3. Pay attention to the permission settings of the shared directory
4. To set up direct access without user name 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
After reading this article, I believe you have some understanding of "how to deploy Samba services under Linux". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
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.