Objective. First, determine if Linux has SMB installed
[Root@localhost zy] #rpm-qa | grep Samba
Samba-2.2.5-10
Samba-swat-2.2.5-10
Samba-common-2.2.5-10
Samba-client-2.2.5-10
Oh this machine has been installed I do not say more, not installed to find the disc installed
First step: Change smb.conf
Let's implement one of the simplest features that allows all users to read and write a folder shared by a Samba server; we need to change smb.conf; First you need to back up the smb.conf file;
[Root@localhost ~]# Cd/etc/samba
[Root@localhost samba]# MV smb.conf Smb.confbak
Then we'll recreate a smb.conf file;
[Root@localhost Samba] #touch smb.conf
Then we write the following paragraph into the smb.conf;
[Global]
Workgroup = Linuxsir
NetBIOS name = LinuxSir05
Server string = Linux Samba Server testserver
Security = Share
[Linuxsir]
Path =/opt/linuxsir
writeable = yes
browseable = yes
Guest OK = yes
Annotations:
This segment of [global] is a global configuration and is required for the segment to be written. These are the following lines;
Workgroup is the workgroup that is displayed in Windows; Here I set the Linuxsir (in uppercase);
NetBIOS name is the computer name that is displayed in Windows;
The server string is the Samba server description that you can define yourself; this is not important;
Security This is the authentication and login method, here we use the share; there are many kinds of authentication methods, this is one of them; another commonly used is the user authentication method; If you use share, you don't have to set up users and passwords;
[Linuxsir] This display in Windows is a shared directory;
Path = You can set where the directory you want to share is placed;
Whether the writeable can be written, here I set to writable;
Browseable Whether you can browse, or you can browse means that we can see the shared folder under the workgroup. If you don't want to show it, set it to Browseable=no.
Guest OK anonymous user is logged in as guest;
The second step: establish the corresponding catalogue and authorize;
[Root@localhost ~]# mkdir-p/opt/linuxsir
[Root@localhost ~]# ID Nobody
Uid=99 (nobody) gid=99 (nobody) groups=99 (nobody)
[Root@localhost ~]# chown-r Nobody:nobody/opt/linuxsir
Note: Regarding the authorization nobody, we first viewed the nobody user's information with the ID command, discovered that his user group is also nobody, we must take this as the standard. Some systems nobody user groups are not nobody;
Step three: Start SMBD and NMBD server;
[Root@localhost ~]# SMBD
[Root@localhost ~]# NMBD
Step Fourth: Check the SMBD process to make sure the Samba server is running;
[Root@localhost ~]# pgrep SMBD
13564
13568
Step Fifth: Access to the samba server share;
In Linux you can use the following commands to access;
[Root@localhost ~]# smbclient-l//linuxsir05
Password: Note: Press ENTER directly
In Windows, you can access them in the following ways;
/linuxsir05