Linux Samba server text configuration method

Source: Internet
Author: User
Tags ftp commands domain server

Text configuration SMB server

Concept
SMB windows sharing protocol
CIFS general internet system
Sharing Mode
1. the Linux host runs the Samba server, and the Windows Host acts as the client;
2. the Linux host runs the Samba server, which is accessed by the samba client program in Linux;
3. The Windows host provides a file sharing server, which is accessed by samba client programs in Linux.

Configuration (1. the Linux host runs the Samba server, and the Windows Host acts as the client ;)

1. Samba package. By default, four related tool kits of Samba are installed in Linux;

2. The "#" section of the/etc/samba/smb. conf file is a comment and ";" section is an example. (if there is more content, select an important department for explanation)
Note: there is a space before and after "=" in this configuration file.
1. Global Configuration)
A) workgroup = mygroup work name, which can be modified
B) Server String = officeshare remarks
C) printcap name =/etc/printcap Printer Driver location
D) Load printers = yes: Is the printer loaded?
E) Security = user/share/Server/Domain
I. User: indicates a security level. You need to enter a password to access
Ii. Share: no password is required for access.
Iii. SERVER: enter the password and specify other Samba servers.
Iv. Domain: You must specify a Domain Server for authentication.
F) host allw = IP/IP segment/which IP addresses or IP segments can be accessed
G) log file =/var/log/samba/% m. log indicates the directory specified by the log. % m indicates the client host name.
H) Max log size = 50 max log space (KB)
I) interfaces = the IP address provided by the IP address (the IP address is set when multiple NICs are deployed on one machine)
J) localmaster = yes: maintains the list of network neighbors
K) OS leverl = 33 maintain the priority of the network neighbor list.

Ii. Shared configuration (homes)
A) Comment = comment
B) browseable = Yes sets hidden sharing (yes, no No)
C) writable = yes the client user can write no to not write
Iii. Use the smbpasswd command
The Samba server maintains its own user account file instead of using the user account of the Linux System for user authentication. the user account file of the Samba server is stored in the "/etc/samba/" directory, the file name is smbpasswd. The initial state smbpasswd file does not exist. It is automatically created when you use the smbpasswd command to create a samba user for the first time.
Smbpasswd-a user name
Enter the password for logging on to the Samba server (you can set a password different from that on the server)
Input again, created successfully
Ls-L/etc/samba/smbpasswd check whether the "smbpasswd" file has been created
CAT/etc/samba/smbpasswd check the content. Is a record added?
Smbpasswd can be followed by other parameters, such:
U-H displays the Command Format help of smbpasswd
U-A adds a specified user account
U-D disables the specified user account
U-e starts the specified user account
U-x deletes the specified user account
U will change the user password when no command option is used.

4. Public directory settings)
I. first, you must create a public folder in the "/home" folder and log on to the client of the folder to have the readable and writable permission on the file. Command: mkdir/home/Public
II. In the smb. conf configuration file, add public shared resources and set:
{
[Public]
Path =/home/Public
Public = Yes
Only guest = Yes
Writable Yes
}
Remove all the semicolons before this section and change them to the configuration file.
5. Test the smb. conf file configuration
Testparm is used to test the integrity of SMB files.

6. Start the Samba server
I. command:

1. Service SMB start SAMBA service
2. View SAMBA service status in service SMB status
3. Service SMB Stop Samba Service
7. log on to the Samba server using Windows // ip
8. Client Configuration
Ii. Similarly, install the RPM package of Samb-Client
Iii. Use commands to connect to the Samba server to share files:
1. smbclient-l IP
2. Enter the password
3. the logon is successful. (operations are similar to FTP commands, and the functions are simple. Therefore, it is not recommended)
4. smbmount // ip/public/mnt: you can mount shared files to the/mnt folder by using smbmoun.
5. When umount/mnt does not need to be shared, the mount can be canceled.
9. Therefore, Linux has been proficient in accessing Windows file sharing, Windows file sharing, and Linux file sharing.
10. If you need to conveniently manage smb. conf configurations, you can manage them in the Web mode and install the SWAT software package. After installation, configure/etc/xinetd. d/in the "only_from = IP segment", after modifying the configuration, restart the SWAT service with the command: service swat restart, then, you can directly enter: http: // ip: 901/in a Windows or Linux Browser, enter the verification password to access and configure

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.