Install smb shared folders in ubuntu

Source: Internet
Author: User
1. install smb and execute the command line: # sudoapt-getinstallsamba # sudoapt-getinstallsmbfs 2. add the folder to be shared. You can use either of the following three methods to configure shared folders: 1. use a graphical interface in ubuntu...
1. install smb and execute the command line: # sudo apt-get install samba # sudo apt-get install smbfs 2. add the shared folder. You can choose one of the following three methods to configure shared folders: 1. in ubuntu, use the sharing function of the graphic interface to press Alt + F2 or open the terminal to name the execution running program interface? Why J? Rui? /Div> shares-admin note: This tool integrates SABMA and NFS to manage shared Directory resources. 2. you can also use a simple graphical management interface to manage the SAMBA service (system-config-samba? Why? Are you sure you want to continue? What is the cangba folder in the upper-right window? /Div> sudo apt-get install system-config-samba? After completion, you can use the system? --> System Management --> samba to start the samba management function of the graphic interface. Www.2cto.com 3. can anyone use this tool to quickly and easily share files in their own directories without having to modify any settings? A. It has been installed by default in ubuntu9.10. if this tool is not installed, run the following command on the terminal to install it. Sudo apt-get install nautilus-share usage to go to your own directory. you can right-click the folder to be shared and select "share option ", in the displayed window, select "share this directory ". If the execution of the sub-process "testparm" fails (there is no such file or directory), you can execute the following installation command. Sudo apt-get install samba-common-bin 3. anonymous access to Ubuntu shared files in windows when samba is used without any settings, the winXP machine can connect to the Ubuntu machine and prompt you to enter the user name and password, at this time, no matter what you enter, do the following settings to achieve anonymous access: 1) modify the configuration file smb. conf: sudo nano/etc/samba/smb. search for "security = user" in conf and change it to "security = share". Then, remove the annotator "#" in front of this line. 2) restart samba: # sudo/etc/init. d/samba restart. in Windows, the folder can be accessed anonymously, but it is read-only and cannot be written. This is true even if the read-only attribute is removed from the Ubuntu GUI. The folder permission can be read and written, and the command is as follows: chmod 777/home/temp (the folder path and name here) 4. in Windows, use the user name and password to access the Ubuntu shared file. below we will share the readable and writable folders of the group. assume that the folder you want to share is: /home/ray/share first create this folder code: # mkdir/home/ray/share # chmod 777/home/ray/share backup and edit smb. conf allows network users to access the code: sudo cp/etc/samba/smb. conf/etc/samba/smb. conf_backup sudo gedit/etc/samba/smb. conf www.2cto.com:; security = user use the following lines to replace the code: security = user username map =/etc/sa Mba/smbusers adds the following lines of code to the end of the file, assuming that the user allowed to access is newsfan. The Share code of the folder is as follows: [Share] comment = Shared Folder with username and password path =/home/ray/share public = yes writable = yes valid users = newsfan create mask = 0700 directory mask = 0700 force user = nobody force group = nogroup available = yes browseable = yes and change it here by the way, find [global] and change workgroup = MSHOME to code: workgroup = WORKGROUP display charset = UTF-8 unix charset = UTF-8 dos charset = cp9 The three lines after 36 are used to prevent Chinese Directory garbled characters. Depending on your local, the UTF-8 may need to be changed to cp936. Do it yourself. Now you need to add the newsfan network access account. If this account does not exist in the system, note the code: sudo useradd newsfan. the newsfan user is added, but the logon password of the local machine is not given to the user. Therefore, this user can only be remotely accessed and cannot log on from the local machine. In addition, the samba logon password can be different from the local logon password. Now you need to add the network user account www.2cto.com code: # sudo smbpasswd-a newsfan # sudo gedit/etc/samba/smbusers add the following line in the new file and save the code: newsfan = "network username" if you need to change newsfan's network access password in the future, use this command to change the code: # sudo smbpasswd-a newsfan command to delete the account of a network user and change-a to-x code: # sudo testparm # sudo/etc/init. d/samba restart
Author: whyspai
Related Article

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.