Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation steps and usage of samba under Ubuntu

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the installation steps and usage of samba under Ubuntu". In the daily operation, I believe that many people have doubts about the installation steps and usage of samba under Ubuntu. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "installation steps and usage of samba under Ubuntu". Next, please follow the editor to study!

Samba is still quite commonly used, I studied Ubuntu samba, here to tell you about the steps of Ubuntu samba installation, I hope to be useful to you. The file or directory sharing function of the Linux system is very powerful and flexible, and its permission control can be very meticulous, of course, if you set it through the command line, it will be a headache for users who have just come into contact with the linux system.

But if you live in a network environment that doesn't require much security, you can create a shared folder under linux in a few simple steps. The following step-by-step instructions take Ubuntu as an example:

Install Ubuntu samba and smbfs:sudo apt-get install samba smbfs

Create a shared directory: sudo mkdir / home/ [username] / [foldername]

Set directory permissions: sudo chmod 777 / home/ [username] / [foldername]

Set up directory sharing: sudo vi / etc/samba/smb.conf

Found: security= user changed to: security= share

Add to the document * *:

[Share]

Path = / home/ [username] / [foldername]

Public = yes

Writable = yes

Restart the service: sudo / etc/init.d/samba restart

Note: the above [username] is the user directory under the linux system, and [foldername] is the folder name, so be careful to replace it when using it.

Okay, now you can access the shared folder of the linux system using\\ ip\ share on your windows terminal.

Content from: script House www.jb51.net

Step to install Ubuntu samba under 1:Ubuntu

# apt-get install samba

# apt-get install smbfs

Step 2: add a linux user

# useradd user1 / / add user name user1

# passwd user1 / / add a password to the username user1

# mkdir / home/user1 / / create the home directory of user1. If you do not use this user name to log in to linux, this step is not required.

# chown-R user1:user1 / home/user1 / / set permissions to the home directory of user1

Step 3: add users to the Ubuntu samba server

Description: the user who logs in to Ubuntu samba must already be a user in linux

# smbpasswd-a user1 / / add and set the Ubuntu samba password for user1

Step 4:smb.conf Settin

# cd / etc/samb / / enter the settings directory

# mv smb.conf smb.conf.bak / / make a backup and directly rename the default configuration file of the system

# vim smb.conf / / create and configure smb.conf files

[global]

Workgrop=x1 / / X1 is the name of the workgroup in your local area network

Server string=x2 / / x2 is your linux host description text, such as: samba server.

The security level of security=user / / samba. User represents the need to enter a user name and password, while changing to share does not require a user name and password.

The name x3 in the [x3] / / box number can be taken at will, only the name of the shared folder displayed in win's network neighbors.

Path=/home/x4 / / x4 is the name of the folder you want to share. Create this folder before sharing and set permissions for access, as explained below.

Valid users=user1 / / this x4 shared directory only allows the user user1 to enter

Public=no / / no means that other users cannot see the x4 directory after entering the Ubuntu samba server except user1. If it is yes, although they can see the x4 directory, no one else can enter the directory except user1.

Writable=yes / / allows user1 to read and write in the x4 directory, otherwise no// saves and exits

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

Step 5: establish a shared directory

# mkdir / home/x4

# chown-R user1:user1 / home/x4 / / because it is a directory created by root, other users only have read permissions, so they have to change their permissions. Of course, you can simply use # chmod 777 / home/x4. Another problem is that if some of the files in the directory in the share can be accessed and some cannot be accessed, it must also be a problem of permissions. Go to / home/x4 and solve it directly # chmod 777 *.

Step 6: restart the Ubuntu samba service

# / etc/init.d/samba restart

Windows XP sharing classic problems disassemble file sharing, printer sharing in detail. These are the operations that we often need to use in our network. However, when this kind of sharing is carried out in Windows XP, there are often some problems, resulting in the sharing can not be completed.

1. Unable to find shared content

When we enter the shared computer name (IP address) in run, we pop up a prompt that can't be found, mostly because the default Windows firewall is enabled. To do this, we just need to right-click the "Network neighbor" icon, open the properties window, then open the "Local connection" properties window, switch to the "Advanced" tab, click the "Settings" button at "Windows Firewall", and then select the "File and Printer sharing" option in the "exception" tab.

Second, unable to select account

To continue the question in the previous step, when accessing the specified shared folder, a login window pops up, but in this window there is only Guest in the user name, and other users cannot be modified in a grayed out state. This is caused by the incorrect verification method of XP. For this, we just need to go to the control panel, open "Local Security Policy" in "Administrative tools", select "Local Policy-Security options" on the left, double-click "Network access: sharing and Security Mode of Local account" on the right, and set it to "Classic-Local users authenticate with their own identity" in the window that opens.

3. Default guests cannot access it

Users have enabled Guset, but still can't access the shared content. At this point, you can continue to open the local security policy, then select "user Rights assignment" under "Local Policy" on the left, double-click "deny access to this computer from the network" on the right, and then delete the Guest account.

IV. Not even authorized users

When accessing shared content, the user is required to enter a user name and password, but the user enters an authorized account, but the login still fails. At this time, it is not necessary to see if your login account is an empty password, if it is an empty password, then in the local security policy, select "Local Policy-Security options". Then double-click "account: local accounts with blank passwords are only allowed to log on to the console" and disable it.

These are just some errors in sharing applications under XP. In fact, most of these errors are caused by unreasonable settings, which can be easily solved as long as you find the source.

At this point, the study of "the installation steps and usage of samba under Ubuntu" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report