Use Samba to share Windows and Linux files

Source: Internet
Author: User
Source: With the popularization of Linux, sharing files in Linux has become a concern for users. In fact, almost all Linux distributions provide a good tool named Samba, which allows you to easily share files. Samba is an application based on the SMB protocol. The current version is 2.3.x. Samba

Source: Free documentation

With the popularity of Linux, sharing files in Linux has become a concern for users. In fact, almost all Linux distributions provide a good tool named Samba, which allows you to easily share files. Samba is an application based on the SMB protocol. The current version is 2.3.x. Samba is powerful, but it is easy to use. The reason is that its configuration file is too large and not easy to understand. new users and skilled users are discouraged from it. However, if only file sharing is implemented, it is easy to configure Samba. you only need to familiarize yourself with several operations. Here is an example to illustrate these operations.
Suppose you are familiar with basic Linux operations and use the VI editor.

Now we have three PCs, one with Win 2000 installed, named test2000, with shared folder share. The other two with Linux installed, and the other with testSamba, there is a directory/pub on it; the other is testlinux, and there is a directory/pub on it. The goal is to share/pub on testSamba for use in test2000 and test_linux.

Perform the following operations on test_Samba:

Find smb. conf in/etc/and open it in VI editor;
# Vi/etc/smb. conf or vi/etc/Samba/smb. conf

Add the netbios record under the [gobal] field, which is generally added to the next line of the workgroup record;
Netbios name = testSamba

Modify the secrity record in the gobal field;
Secrity = share

Under the public field, modify the path record;
Path =/pub

Under the public field, add the geuest OK record;
Guest OK = yes

Delete the ";" sign at the beginning of each line of the "public" field;

Save and exit.

The added "netbios name" is the name of the machine that can be seen in the test2000 network neighbor. the added/pub is the shared directory that can be seen in the network neighbor; adding guest OK allows all users to access and share with their guest accounts. deleting ";" indicates that the entire [public] field is executable.

Now/pub is the directory that can be shared by test2000 and testlinux machines. Easy!

Try:

Under testSamba, you can perform the following operations to use shared folders under test2000:

# Smbclient-L // test2000

This command can view the sharing information under test2000. Note that when the system requires a password, press enter to enter test2000. the sharing information under test2000 is listed on the screen.

# Smbclient \ test2000 \ share-U share

This command can go to the share directory of test2000, and the MS-DOS prompt (: \) on the screen shows that the user is in the share directory. Enter "? "Command to find the command you can use.

In test2000, use the shared directory/pub of testSamba to perform the following operations:

Search for the testSamba computer. when the testSamba target appears, double-click the pub icon to enter the shared folder pub.

In testlinux, use the shared directory pub of testSamba to perform the following operations (assuming that pub exists ):

# Smbmount // testSamba/pub

This command can mount pub under testSamba to pub on the local machine. press enter directly when the system requires the password, and then enter # cd/pub, # ls in sequence, the screen lists the files in the pub directory of testSamba.

Windows 2000 shares files with Linux.

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.