UbuntuServer11.10 configure Samba

Source: Internet
Author: User
Samba is a server software that simulates Windows File/print sharing in Linux. It is very useful in Linux/Windows hybrid network environments. Install Sambawww.linuxidc.com @ linuxidc :~ $ Sudotasksel select [*] Sambafileserver, press [tab] to jump to & lt; OK & gt;, and press Enter. Simple. You can also $ sudoapt-getinstils

Samba is a server software that simulates Windows File/print sharing in Linux. It is very useful in Linux/Windows hybrid network environments.

Install Samba
Www.linuxidc.com @ linuxidc :~ $ Sudo tasksel

Select [*] Samba file server, and press [tab] to jump , And press Enter. It's very easy. You can also use $ sudo apt-get install samba, which has never been tried in Ubuntu. It should be the same.

1. Create a shared directory for anyone to read, write, and execute
Www.linuxidc.com @ linuxidc :~ $ Sudo mkdir/opt/smbshare
Www.linuxidc.com @ linuxidc :~ $ Sudo chmod 777/opt/smbshare
Www.linuxidc.com @ linuxidc :~ $

2. Edit the configuration file
Www.linuxidc.com @ linuxidc :~ $ Sudo cp/etc/samba/smb. conf/etc/samba/smb. conf_backup
Www.linuxidc.com @ linuxidc :~ $ Sudo vi/etc/samba/smb. conf

1. Find [global]
Workgroup = WORKGROUP
Displays charset = UTF-8
Unix charset = UTF-8
Dos charset = cp936

2. Search for this line of text code:
# Security = user
Replace the following two rows
Security = user
Username map =/etc/samba/smbusers

3. Add the following in the last line:
[Devshare]
Comment = Shared Folder with username and password
Path =/opt/smbshare
Public = yes
Writable = yes
Valid users = dev
Create mask = 0777
Directory mask = 0777
Force user = nobody
Force group = nogroup
Available = yes
Browseable = yes
Exit and save.

Iii. samba users
1. create user dev
Www.linuxidc.com @ linuxidc :~ $ Sudo useradd dev

2. Assign the smb password to dev. Note that this is not the local logon password and the local logon password is not set.
Www.linuxidc.com @ linuxidc :~ $ Sudo smbpasswd-a dev
New SMB password:
Retype new SMB password:
Www.linuxidc.com @ linuxidc :~ $

3. edit/etc/samba/smbusers
Www.linuxidc.com @ linuxidc :~ $ Sudo vi/etc/samba/smbusers
Add downstream:
Dev = "Samba user ."

Exit and save.

If the firewall UFW is enabled, you must allow the samba port.
Www.linuxidc.com @ linuxidc :~ $ Sudo ufw allow139/tcp
Rules updated
Rules updated (v6)
Www.linuxidc.com @ linuxidc :~ $ Sudo ufw allow445/tcp
Rules updated
Rules updated (v6)

4. Test the samba server
1. Restart smbd
Www.linuxidc.com @ linuxidc :~ $ Sudo service smbd restart
Smbd start/running, process 9873
Www.linuxidc.com @ linuxidc :~ $

2. server test:
Www.linuxidc.com @ linuxidc :~ $ Sudo testparm
Load smb config files from/etc/samba/smb. conf
Rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print $]"
Processing section "[devshare]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions [enter]
[Global]
Dos charset = cp936
Displays charset = UTF-8
Server string = % h server (Samba, Ubuntu)
Map to guest = Bad User
Obey pam restrictions = Yes
Pam password change = Yes
Passwd program =/usr/bin/passwd % u
Passwd chat = * Enter \ snew \ s * \ spassword: * % n \ n * Retype \ snew \ s * \ spassword: * % n \ n * password \ supdated \ ssuccessfully *.
Username map =/etc/samba/smbusers
Unix password sync = Yes
Syslog = 0
Log file =/var/log/samba/log. % m
Max log size = 1000
Dns proxy = No
Usershare allow guests = Yes
Panic action =/usr/share/samba/panic-action % d

[Printers]
Comment = All Printers
Path =/var/spool/samba
Create mask = 0700
Printable = Yes
Browseable = No

[Print $]
Comment = Printer Drivers
Path =/var/lib/samba/printers
Browseable = No

[Devshare]
Comment = Shared Folder for DEV
Path =/opt/smbshare
Valid users = dev
Force user = nobody
Force group = nogroup
Read only = No
Create mask = 0777
Directory mask = 0777
Guest OK = Yes
Www.linuxidc.com @ linuxidc :~ $

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.