The file or directory sharing Function in Linux is very powerful and flexible, and its permission control can be very meticulous, of course, if you set it through the command line method, it will be a headache for users who are new to Linux. However, if your network environment does not have high security requirements, you can create a shared folder in Linux with just a few simple steps. The following uses Ubuntu as an example to describe the steps:
Install 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 Directory sharing: sudo VI/etc/samba/smb. conf
Find:
; Security = user
Changed:
Security = Share
Add the following at the end of the document:
[Share]
Path =/home/[username]/[Foldername]
Public = Yes
Writable = Yes
Restart the service: sudo/etc/init. d/samba restart
Note: The preceding [username] is the user directory in Linux and the [Foldername] is the folder name. Replace it with your username.
Now, on your Windows terminal, you can use // ip/share to access the shared folder in Linux.
Content from: script home www.jb51.net
//////////////////////////////////////// //////////////////////////////////////// //////
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 ,{
If (typeof (showtitle )! = 'Undefined') {This. Title = ''; window. cleartimeout (hideto); showtitle (event, this, 0 ,'');}
} "Onmouseout =" function onmouseout ()
{
If (typeof (showtitle )! = 'Undefined') {mouseisoverlayer = false; mouseoverwhileload = false; hideto = Window. setTimeout ('checkifmouseoverlayer () ', 500 );}
} "Href =" http://action.utops.cc/click.jsp? Adsid = 318 & adsleagueid = 5 & adsuserid = 713 & siteid = 657 & siteleagueid = 5 & siteuserid = 564 & SCID = 2 & adstype = 2 & prices = 0.8 & checkcode = login & click = 1 & url = http % 3A // www.zippohottour.com.cn & V = 0 & keyword = % u5982 % u679c & s = http % 3A // users "target =" _ blank "> if you do not need this user name to log on to Linux, this step is not required
# 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
//////////////////////////////////////// //////////////////////////////////////// ////////////////
Detailed troubleshooting of Windows XP sharing classic issues
File Sharing, printer sharing ...... These operations are frequently used in our networks. However, some problems often occur during such sharing in Windows XP, leading to the failure of sharing.
1. Shared content cannot be found
When we enter "shared computer name (IP address)" in "run", the system cannot be found. In this case, the default Windows Firewall is enabled. In this regard, we only need to right-click the "Network Neighbor" icon to open the Properties window, then open the "local connection" Properties window, switch to the "advanced" tab, click the "Settings" button at "Windows Firewall" and select "file and printer sharing" in the "exceptions" tab.
2. Unable to select an account
Continue to the previous step. When you access the specified shared folder, the logon window is displayed. However, in this window, the user name is only guest, and other users cannot be modified in the gray state. This is caused by incorrect XP verification methods. In this regard, we only need to go to the control panel, open "Local Security Policy" in "Administrative Tools", and then select "local policy-security option" on the left ", double-click "Network Access: sharing and security mode of the Local Account" on the right, and set it to "classic-Local User Authentication" in the window that appears.
3. access is denied by default.
The user has enabled guset, but still cannot access shared content. In this case, you can continue to open the Local Security Policy, select "User Rights Assignment" under "Local Policy" on the left, and double-click "Deny access to this computer from the network" on the right ", delete the Guest account.
4. No way to authorize a user
When accessing shared content, you must enter the user name and password, but the user enters the authorized account, but the login still fails. In this case, check whether your Logon account has a blank password. If the password is blank, select "local policy-Security Options" in the Local Security Policy, and double-click "account: A local account with a blank password can only log on to the console. "disable it.
This is only because many errors occur in shared applications under xp. In fact, most of these errors are caused by unreasonable settings. It can be easily solved by finding the source.