Install Samba server in Ubuntu

Source: Internet
Author: User

Install the Samba server in Ubuntu:

Step 1: Install Samba in Ubuntu

# Apt-Get install samba

# Apt-Get install smbfs

Step 2: Add a Linux User

# Useradd user1 // Add user1

# Passwd user1 // Add a password to user1

# Mkdir/home/user1 // create the Home Directory of user1. this step is not required if you do not need this user name to log on to Linux.

 

# Chown-r user1: user1/home/user1 // Set permissions for the home directory of user1

Step 3: Add a user to the Samba server

Note: users logging on to Samba must already be users in Linux.

# Smbpasswd-A user1 // Add and set the samba password for user1

Step 4: Configure smb. conf

# Cd/etc/Samb // enter the setting directory

# Mv smb. conf smb. conf. Bak // back up the file and rename the default configuration file.

# Vim smb. conf // create and configure the smb. conf file

[Global]

Workgrop = x1 // X1 is the name of the Working Group in your LAN

Server String = x2 // X2 is a descriptive text of your Linux host, such as Samba server.

Security = user // Samba security level. User indicates that you need to enter the user name and password. If you change to share, you do not need to enter the user name and password.

[X3] // The X3 name in the box number can be obtained at will, but the shared folder name displayed in the win's network neighbor

Path =/home/X4 // X4 name of the folder to be shared. Create this folder before sharing and Set permissions for access.

Step 1: Install Samba in Ubuntu

# Apt-Get install samba

# Apt-Get install smbfs

Step 2: Add a Linux User

# Useradd user1 // Add user1

# Passwd user1 // Add a password to user1

# Mkdir/home/user1 // create the Home Directory of user1. this step is not required if you do not need this user name to log on to Linux.

 

# Chown-r user1: user1/home/user1 // Set permissions for the home directory of user1

Step 3: Add a user to the Samba server

Note: users logging on to Samba must already be users in Linux.

# Smbpasswd-A user1 // Add and set the samba password for user1

Step 4: Configure smb. conf

# Cd/etc/Samb // enter the setting directory

# Mv smb. conf smb. conf. Bak // back up the file and rename the default configuration file.

# Vim smb. conf // create and configure the smb. conf file

[Global]

Workgrop = x1 // X1 is the name of the Working Group in your LAN

Server String = x2 // X2 is a descriptive text of your Linux host, such as Samba server.

Security = user // Samba security level. User indicates that you need to enter the user name and password. If you change to share, you do not need to enter the user name and password.

[X3] // The X3 name in the box number can be obtained at will, but the shared folder name displayed in the win's network neighbor

Path =/home/X4 // X4 name of the folder to be shared. Create this folder before sharing and Set permissions for access.

Valid users = user1 // This X4 shared directory only allows this user to access

Public = No // No indicates that except the user1 user, other users cannot see the X4 directory after entering the Samba server. If yes, although the X4 directory can be seen, however, the user except user1 can enter this directory, and others cannot.

Writable = Yes // allow user1 to read and write data in the X4 directory; otherwise, no

// Save the disk and exit

# Testparm // check for syntax errors, such as spelling errors

Step 5: create a shared directory

# Mkdir/home/X4

# Chown-r user1: user1/home/X4 // because the directory is created by the root user, other users only have the read permission and must change the permission. Of course, you can also simply use # chmod 777/home/X4. Another problem is that if some files in the shared directory can be accessed and some files cannot be accessed, it must also be the permission problem. Go to/home/X4 and directly # chmod 777.

Step 6: restart the samba Service

#/Etc/init. d/samba restart

Public = No // No indicates that except the user1 user, other users cannot see the X4 directory after entering the Samba server. If yes, although the X4 directory can be seen, however, the user except user1 can enter this directory, and others cannot.

Writable = Yes // allow user1 to read and write data in the X4 directory; otherwise, no

// Save the disk and exit

# Testparm // check for syntax errors, such as spelling errors

Step 5: create a shared directory

# Mkdir/home/X4

# Chown-r user1: user1/home/X4 // because the directory is created by the root user, other users only have the read permission and must change the permission. Of course, you can also simply use # chmod 777/home/X4. Another problem is that if some files in the shared directory can be accessed and some files cannot be accessed, it must also be the permission problem. Go to/home/X4 and directly # chmod 777.

Step 6: restart the samba Service

#/Etc/init. d/samba restart

 

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.