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 > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to quickly get started with Samba in Linux, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.
Samba is a free software that implements SMB protocol on Linux and UNIX systems, which is composed of server and client programs. With the popularity of Linux, how to share files under Linux has become an issue of concern to users. In fact, almost all Linux distributions provide a good tool Samba-- to easily achieve file sharing.
Install samba
I use centos7, so I can install it directly with yum.
Yum install samba configuration smb.conf
Smb.conf is a configuration file on the server side. It comes with a smb.conf file as soon as it is installed, and there are a lot of comment lines in it, but the actual work is not available, so we back up the self-contained file and copy a concise main configuration file.
Mv / etc/samba/smb.conf / etc/samba/smb_bak.confcat / etc/samba/smb_bak.conf | grep-v "#" | grep-v ";" > / etc/samba/smb.conf
Edit the smb.conf file, delete the homes, printers, and print$ configurations, which are not needed in the actual work, and then add your shared file configuration. The final content is as follows:
[global] workgroup = SAMBA # sets the workgroup or domain to which Samba Server will join. Security = user # sets the authentication method for users to access Samba Server There are four authentication methods: passdb backend = tdbsam printing = cups printcap name = cups load printers = yes cups options = raw [database] comment = share database # this is the description of the shared file path = / data/share # set the path to the shared folder public = no # set whether to allow anonymous access writable = yes create samba login user
This user can directly use the Linux user, but the password also needs to be set, so I create a new samba dedicated user here
Useradd smb_rootsmbpasswd-a smb_root # and then enter the password twice to create the shared path mkdir-p / data/sharecd / datachmod-R 775 sharechown-R smb_root:smb_root shareWindows to access shared files
Enter\\ + ip on the Windows explorer address (for example, if my samba server IP address is 192.168.1.14, enter\\ 192.168.1.14) to log in to Samba service
Just enter the newly added samba user and password, for example, mine is smb_root and smb_root, so you can access it.
You can map this file to a drive letter. Select database, right-click, and select Map Network Drive.
Just click OK.
Share files under Linux
First install cifs-utils, a software package that supports file sharing services, on the client side
Yum install cifs-utils
On the Linux client, the relevant information is written to an authentication file in the order of the user name and password of the samba server and the shared domain.
Vim auth.smb writes the following: username = smb_rootpassword = smb_rootdomain = ZIJIN
Create a shared directory on the client and write the mount information into the / etc/fstab file
Mkdir-p / data/sharevim / etc/fstab adds some information at the end: / / 192.168.1.14/data/share / data/share cifs credentials=/root/auth.smb 0 0
Mount the file system
Mount-a
Test, create a new file under the / data/share directory on the server, and then check on the client to see if you can see it, if you can.
Thank you for reading this article carefully. I hope the article "how to get started with Samba in Linux" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.