Article Title: configure the Samba server for Solaris. 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.
This article describes how to use SAMBA to share files between Solaris and Windows.
I. Overview
Samba provides file and printer sharing services between Unix and Windows systems. If Samba Server is configured on a Solaris Server, it can act as a shared Server. It can also be used as a client to access shared files on other Windows systems in the network, or other shared files on Solaris/Linux systems installed with Samba Server.
OpenSolaris has included Samba during system installation. You only need simple configuration to become a Samba Server.
2. Configure the Samba server of Solaris
The Samba server contains two Daemon, nmbd, and smbd. Smbd is the kernel of samba and serves as the basis for establishing conversations, verifying customers and providing file systems and print services. nmbd processes all name registration and resolution requests, enabling web browsing; its task is to broadcast the services provided by Samba server to the LAN. Nmbd enables the Samba server to display in the network neighbors of the windows operating system, allowing users to browse resources that can be used by samba.
By default, OpenSolaris does not enable the Samba service.
# Svcs-v | grep samba
# Ps-eaf | grep mbd
Samba can be shared by share, user, server, domain, and ads. This article mainly introduces the sharing methods of share and user.
2.1 configure share mode
The share mode allows users to log on to the samba server without entering their account and password. The configuration steps are as follows:
1) create a Samba shared directory
# Mkdir-p/export/home/smbshare
2) create a Samba configuration file
# Cp/etc/sfw/smb. conf-example/etc/sfw/smb. conf
3) edit the configuration file smb. conf.
===========/ Usr/sfw/smb. conf ==============
Security = share
[Homes]
Comment = Home Directories
Browseable = yes
Writable = yes
Path =/export/home/smbshare
Guest OK = yes
Guest account = user1
In this example, the user logs in through the default user1. After logging in, you can see the files shared by user1 and all the files shared by the system. The files shared by other users can be viewed, but they cannot be used or used. If you do not set a guest account, you can log on with the default nobody and only use the shared files set by the system. Files set by other users may not be used.
4) Start the Samba Service
# Svcadm enable samba
# Svcs | grep samba
Online1: 19: 02svc:/network/samba: default
# Ps-eaf | grep mbd
Root 24453 1 0 01:19:02? 0: 00/usr/sfw/bin/smbd-D
Root 24450 1 0 01:19:02? 0: 00/usr/sfw/bin/nmbd-D
Root 24454 24453 0 01:19:02? 0: 00/usr/sfw/bin/smbd-D
2.2 configure the user mode
The user name and password must be provided for verification. Here, Samba users must be Solaris users. For the same user, the samba password and system password do not have to be the same.
1) Add a system user (you can also use an existing user)
# Useradd-d/export/home/andy-m-s/usr/bin/bash andy
2) use smbpasswd to add Samba users
#/Usr/sfw/bin/smbpasswd-a andy
New SMB password:
Retype new SMB password:
Added user andy.
#/Usr/sfw/bin/smbpasswd-e andy
Enabled user andy
3) edit the configuration file smb. conf.
===========/ Usr/sfw/smb. conf ==============
Security = user
[Homes]
Comment = Home Directories for % S
Valid users = % S # Only the owner can access the share.
Browseable = no # this share is invisible to other users
Writable = yes
Create mask = 0640 # permission mask when creating a file
Directory mask = 0750 # permission mask when creating a directory
Here, the % S wildcard can be extended to the actual sharing name. In this way, the Comment shared by andy will be "Home Directories for andy ".
4) restart the Samba service.
# Svcadm restart samba
When samba is used to access the Solaris machine from other systems, if the username is andy and the password is Samba, you can see the content in/export/home/andy.
[1] [2] Next page