Smb Service (shared by Linux and windows)

Source: Internet
Author: User
Smb Service (Linux and windows sharing)-Linux general technology-Linux technology and application information, the following is a detailed description. Smb Service (shared by Linux and windows)
First turn off the Firewall
Enter iptables-F on the terminal
Or
System -- manage -- firewall -- disable
Step 1: Change smb. conf
Let's implement the simplest function, so that all users can read and write a folder shared by a Samba server. Let's change it.
Smb. conf; first, back up the smb. conf file;
[Root @ localhost ~] # Cd/etc/samba
[Root @ localhost samba] # mv smb. conf smb. confBAK
Then we will recreate an smb. conf file;
[Root @ localhost samba] # touch smb. conf
Then we write the following section into smb. conf;
[Global]
Workgroup = RANBE
Netbios name = wzlinux
Server string = Linux Samba Server TestServer
Security = share
[Linuxsir]
Path =/media/ranbe
Writeable = yes
Browseable = yes
Guest OK = yes
Note:
[Global] This section is a global configuration and is required. There are the following rows;
Workgroup is the working group displayed in Windows; here I set RANBE (in upper case );
Netbios name is the name of the computer displayed in Windows;
Server string is the description of the Samba server, which can be defined by yourself. This is not important;
Security: authentication and login methods. Here we use share. There are many authentication methods, one of which is also commonly used.
User authentication method; If share is used, you do not need to set the user and password;
[Linuxsir] the shared directory is displayed in Windows;
Path = You can set where the directory to be shared is stored;
Whether writeable can be written. Here I set it to writable;
Whether browseable can be viewed or not. If browsed, we can see shared folders under the Working Group. If you do not want to display
Then set it to browseable = no.
Guest OK anonymous users log on as guest;
Run testparm after/etc/smb. conf is configured to check whether the corresponding syntax error exists in the configuration file.
After samba is started, use smbstatus to report user usage and logon status.
After changing the configuration file, run/etc/rc. d/init. d/smb restart to re-read the configuration file.
Or service smb restart

Step 2: create a directory and grant permissions;
[Root @ localhost ~] # Mkdir-p/media/ranbe
[Root @ localhost ~] # Id nobody
Show uid = 99 (nobody) gid = 99 (nobody) groups = 99 (nobody)
[Root @ localhost ~] # Chown-R nobody: nobody/media/ranbe
Note: For nobody authorization, we first use the id command to view the information of the nobody user and find that the user group is also nobody.
This prevails. In some systems, the nobody user group is not the nobody;
(Step 3: Start smbd and nmbd servers
([Root @ localhost ~] # Smbd
[Root @ localhost ~] # Nmbd) can be omitted
[Root @ localhost ~] # Service smb restart
Step 4: Check the smbd process and check whether the Samba server is running;
[Root @ localhost ~] # Pgrep smbd
13564
13568
View the Samba service running status: # service smb status
) Can be omitted.
Step 5: Access Samba server sharing;
Enter "ifconfig eth0 192.168.0.2 (to be in an IP segment with your windows)" on the terminal to configure an IP address for linux.
Ping the windows IP address to check whether the network is connected.
The connection is complete.
In Linux, you can use the following command to access;
Mount // 222.204.17.106/s3c2410/root/windows
222.204.17.106 xp ip Address
Shared directory of s3c2410 xp
Root/windows Mount location to linux
In Windows, you can use the following method to access;
In the ie Address Bar
\ 222.204.17.70 \ meida \ ranbe
Unaccessible
You can also set to automatically start the Samba service when the system restarts: # chkconfig -- level 345 smb on
Or enter setup in the terminal
Select System Service
  • Smb
  • 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.