Linux usage tips 2--ubuntu using Samba to create shared folders

Source: Internet
Author: User

Friendship Help: Bo Master to participate in the 2014 blog Star selection, please support a lot Oh! Click here for the vote link!


Samba, a bridge that connects Unix camps and Windows systems. Install the Samba server on a Unix-like system to allow Windows systems to access the specified folders in a UNIX-type system as if they were accessing a shared folder.

Samba, Samba is also it! Give the software a sexy name and think about whether it's drunk.

With this little guy, we solved the big trouble of accessing files from multiple systems on our LAN. Here's the whole process.

1. Installation Samba,apt-get recommended I install SAMBA4.
sudo apt-get install SAMBA4

Error encountered during installation:
/var/lib/dpkg/info/samba4.postinst:14:/var/lib/dpkg/info/samba4.postinst:/usr/share/samba/setoption.pl: Permission denieddpkg:error processing Samba4 (--configure): subprocess installed post-installation script returned Error exit status 126Errors were encountered while Processing:samba4e:sub-process/usr/bin/dpkg returned an error code (1 )

Should be my dpkg problem, originated in the last Apt-get upgrade midway by my artificial block.
The workaround is to delete the/var/lib/dpkg/info folder and recreate it.
Cd/var/lib/dpkgsudo MV Info Info.baksudo mkdir Info
Re-install is possible.
2. Create a folder under/home to share
home$ sudo mkdir sharehome$ sudo chmod 777 share
Create a file in the share folder, and use it as a sign of successful access.
3. You can make a backup before you modify the SMB configuration file
Find the word security = user, and if it is commented, let go of the comment.
After that, add a sentence: username map =/etc/samba/smbusers
Add the following statement at the end of the file:

The path of the file is set above and the available user is friend.

Search again [global]
Under workgroup = Workgroup, add the following:
Display CharSet = Utf-8unix CharSet = Utf-8dos CharSet = cp936
Save and exit.
4. Add friend Account
home$ sudo useradd friend
Set the SMB password for friend
home$ sudo smbpasswd-a friendnew smb password:retype new SMB password:added user friend.
5. Create a new Smbusers file and add a line statement
home$ sudo vim/etc/samba/smbusersfriend = "Network username"
6. Restart SMBD
home$ sudo service smbd restart

View SMBD Listening ports
home$ sudo netstat-tlnp | grep SMB
TCP 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 5224/smbd
TCP 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 5224/smbd
7. Test command line Input \\my IP in Windows
You can access it.

Reference:
http://linux.vbird.org/linux_server/0370samba.php

Linux usage tips 2--ubuntu using Samba to create shared folders

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.