LinuxSamba Server SETUP

Source: Internet
Author: User
LinuxSamba server setup-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Today, I am bored, so I started playing with Linux Samba. Oh... the system environment is Ubuntu 7. 04...
Since the server is set up, let's talk about the configuration of Samba's server... because the system is Ubuntu, the system automatically completes sudo apt-get install samba after the software is installed and does not need to consider software dependencies, which is quite convenient... after Samba is installed, let's take a look at the Samba configuration file and find/etc/samba/--> ls. The directory contains smb. conf and smbpasswd, where smb. conf is the main configuration file, while smbpasswd is the table corresponding to the user/password. The Samba execution file contains smbd and nmbd (Samba starts daemons), and testparm (check whether the setting is wrong ), smbpasswd (create password file), smbclient (view the directories and devices shared by the computer), and smbmount (Mount shared directories and devices ). in addition, there are other related directories of Samba, such as log files and help documents.
Okay. Next, configure smb. conf.

[Global] # host settings
Workgroup = workgroup name
Server string = Host description
Netbios name = Host name
Security = share (Secure Login not performed) | user (secure login, password file related to smbpasswd) | domain (using Samba as PDC)
Encrypt passwords = yes (enter password) | no (no password required)
Smb passwd file =/etc/samba/smbpasswd Password file
Log file =/var/log/samba/log. % m log file, which can be changed
Max log size = 0 log file size, 0 is unlimited, unit: KB
Load printers = yes
Printing = lprng printer

[Share Directory]
Comment = directory description
Path = real directory corresponding to the shared name
Read only = read-only or not
Public = whether all users can log on
Writable = writable or not. If read only = no and writable = yes, writable prevails.
Create mode = create a New File Permission
Directory mode = create a new directory permission


Well, these are the basic configurations. Here are two examples to illustrate...
No permission for directory sharing
First, the host settings:
[Global]
Workgroup = frog studio
Server string = Ubuntu Samba Server
Log file =/var/log/samba/log. % m
Security = share
Encrypt passwords = no
(Others are set by default)

Then configure the shared directory:
[Share Directory]
Comment = My Share Directory
Path =/home/share
Read only = yes
Public = yes
Writable = yes

After the settings are complete, enter testparm to test whether our settings are correct. If yes, the system will remind you... after confirming there are no errors, we need to restart our Samba server to make the settings take effect:
/Etc/init. d/samba restart
Next we will perform a client self-test:
Smbclient-L // localhost
Then we can see the Directory name Share Directory we just shared, haha... go to the Windows Network to find out, and we can access the Linux shared directory... okay. Here we will improve our permissions:

Host settings
[Global]
Workgroup = frog studio
Server string = Ubuntu Samba Server
Log file =/var/log/samba/log. % m
Security = user
Encrypt passwords = yes
Smb passwd file =/etc/samba/smbpasswd

Shared directory settings
[Share Directory 2]
Comment = My Share Directory 2
Path =/home/share2
Writable = yes
Valid users = % S (permitted entrants)
Create mode = 0664
Directory mode = 0775

After the configuration is complete, restart the Samba server again, but now do not rush to windows for testing, because this requires a user name and password. Next we will first create a login user and login password:
Useradd smb (Create a system user name)
Passwd smb (create system user password)
Smbpasswd-a smb (add a user to the password file)
# Smbpasswd-d smb (pause user logon)
# Smbpasswd-e smb (resume user suspension)
# Smbpasswd-x smb (delete user)
For more operations, see man smbpasswd
After creating the password file, test Samba settings, testparm. After the test is normal, check our shared directory:
Smbclient-L // localhost
Everything is ready. Open the network neighbors in windows, log on to the shared directory, and enter the user password... now we can see the shared directory in Linux, and we can create and delete files at will. Let's connect Windows and Linux...

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.