Article Title: Samba oralinux system Samba server setup. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
System Environment: Windows xp sp3, IP: 192.168.1.10 Virtual Machine with Fedora-8-i386 IP: 192.168.1.12 installed
1. Check whether samba is installed on the OS.
[Root @ cisco samba] # rpm-qa | grep smb
If the following three lines are displayed, Samba has been installed.
Libsmbios-libs-0.13.10-1.fc8
Libsmbios-bin-0.13.10-1.fc8
Pam_smb-1.1.7-7.2.2
If not installed, you need to enter the installation off disk Fedora-8-i386-DVD.iso
[Root @ cisco/] # mount/dev/cdrom/mnt/cdrom/
Mount: block device/dev/sr0 is write-protected, mounting read-only
[Root @ cisco/] # cd/mnt/cdrom/
[Root @ cisco cdrom] # ls
Fedora.css isolinux README-BURNING-ISOS-en_US.txt repoview RPM-GPG-KEY-fedora RPM-GPG-KEY-rawhide
GPL media. repo RELEASE-NOTES-en_US.html RPM-GPG-KEY RPM-GPG-KEY-fedora-rawhide stylesheet-images
Images Packages repodata RPM-GPG-KEY-beta RPM-GPG-KEY-fedora-test TRANS. TBL
[Root @ cisco cdrom] # cd Packages/
[Root @ cisco Packages] # rpm-ivh-aid smb *
The installation is successful.
2. Enter the samba directory
[Root @ cisco/] # cd/etc/samba/
[Root @ cisco samba] # ls
Lmhosts smb. conf smbpasswd smbusers
Smb. conf is the main configuration file of the samba server.
Note that the smbpasswd file is used to store the user account and the md5 encrypted password.
This file does not exist when the samba service is installed. You need to create it manually. The following section describes how to create an ECS instance.
3. Edit the smb. conf file
[Root @ cisco samba] # vi smb. conf
Perform the following settings:
#====================================== Global Settings ==================== ======================================
[Global]
Workgroup = the name of the Working Group that MSHOME adds linux to. I have joined the Working Group MSHOME.
Server string = Samba this is the server description to facilitate resource marking. You can enter it as needed.
Encrypt passwords = yes indicates whether to encrypt the user's password. Here, select encryption to ensure security!
Public = yes defines whether a share is open to public access. When set to yes, there is no account user on the system
Access is received based on the defined attributes of the Customer Account.
Smb passwd file =/etc/samba/smbpasswd this is the account password storage file
Netbios name = mm's information displayed when samba accesses the samba server externally.
# -- Logging Options --
# Logs split per machine
Log file =/var/log/samba/log. % m log file storage location.
# Max 50KB per log file, then rotate
Max log size = 0 limit on the size of log files. If it is set to 0, no limit is imposed.
# -- Standalone Server Options --
Security = user-shared security level. samba has four security levels:
Share: you can log on to the samba server without your account and password.
User: the samba server that provides services is responsible for checking the account and password (default)
Server: Another windows or samba server is responsible for checking the account and password.
Domain: Specifies the windows domain control server to verify the user's account and password)
Passdb backend = tdbsam
These are general configurations.
Add the directory we want to share to/opt/
Add the following code:
[Rose]
Comment = This is my samba server! Set the shared information.
Path =/opt shared directory
Valid users = testuser: the user who can access the shared directory. Here I set it to testuser.
Public = yes.
Writable = yes indicates whether the user can write data. We allow it here.
Wq!
Save and exit.
4. Start the smb service
[Root @ cisco samba] # service smb start
Starting SMB services: [OK]
[Root @ cisco samba] # service nmb start
Starting NMB services: [OK]
5. Add the user testuser who can access the shared directory we just set up.
1) Create a system user
[Root @ linux samba] # useradd testuser (create a user named testuser)
[Root @ linux samba] # passwd t (add a password to the testuser user)
Changing password for user samba.
New password: (the password must contain more than six characters and is not displayed on the screen)
Bad password: it does not contain enough DIFFERENT characters
Retype new password: (confirm the password)
Passwd: all authentication tokens updated successfully
2) Update the/etv/samba/smbpasswd file.
[Root @ linux samba] # cat/etc/passwd | mksmbpasswd. sh>/etc/samba/smbpasswd
3) create a samba account.
[Root @ cisco samba] # smbpasswd-a testuser
New SMB password:
Retype new SMB password:
Added user testuser.
6. Restart the smb service.
[Root @ cisco samba] # service smb restart
Shutting down SMB services: [OK]
Starting SMB services: [OK]
[Root @ cisco samba] # service nmb restart
Shutting down NMB services: [OK]
Starting NMB services: [OK]
Next we will test it in Windows. My system is Windows xp sp3.
Access Windows Shared Resources in Linux with the following information:
[Root @ cisco samba] # smbclient-L // 192.168.1.10
Password:
Domain = [XPSP3] OS = [Windows 5.1] Server = [Windows 2000 LAN Manager]
Sharename Type Comment
--------------------
Printer Adobe PDF Office Document Image Writer
Session request to 192.168.1.10 failed (Called name not present)
Session request to 192 failed (Called name not present)
Domain = [XPSP3] OS = [Windows 5.1] Server = [Windows 2000 LAN Manager]
Server Comment
----------------
Workgroup Master
----------------
Access your samba server in Linux and the following information is displayed:
[Root @ cisco samba] # smbclient-L // 192.168.1.12
Password:
Anonymous login successful
Domain = [MSHOME] OS = [Unix] Server = [Samba 3.0.26a-6. fc8]
Sharename Type Comment
--------------------
Homes Disk Home Directories
Rose Disk This is my samba server!
Test-1 Disk This is my samba server!
IPC $ IPC Service (Samba)
Anonymous login successful
Domain = [MSHOME] OS = [Unix] Server = [Samba 3.0.26a-6. fc8]
Server Comment
----------------
MM's SAMBA
Workgroup Master
----------------
MSHOME