|
Blue Forest http://www.lslnet.com at 3:18 p.m. on August 18, 2006
How Linux server configuration smba Smba ask everyone in the Linux server configuration? ? ?
: P |
How Linux server configuration smba Learn some first base.
Samba is the core of two smbd and nmbd daemon process started to stop during the continuous operation of the server. And the entire Smbd nmbd
Allocation of the Ministry of Information to preserve all documents in smb.conf. Smb.conf to two smbd and nmbd daemon shows what output to be shared
Who and how to share the output exported. Smbd role in the process of dealing with the arrival of the SMB software, and resources for the use of the package
Linux consultations nmbd process so that other server (or workstation) can browse the Linux server.
If installed with rpm installed, then do not start samba service smb start with service nmbd start, the service could start the smbd.
Smb.conf document in the Notes to put "#" at the beginning, each of the letters make no distinction between English and capitalization, in the end his character last increase
"\" Can be divided into his trip. "; "At the beginning of the trip is to change the allocation"; "Removed, the distribution will take effect.
[global] (Overall parameters, it has great influence over the functions of samba, the whole system is mainly used to set up the rules.
Workgroup= This is the domain in your windows.
This is in the Windows server string= see your samba interpretation.
Netbios name = your machine is the best, and if the sentence changed to cancel and acquiesce in the Linux machines is your name, but his best to fill
Dos charset=cp936
The second line charset=cp936 Unix can correct this with the Chinese.
Linux-samba hosts allow the mainframe to allow the entry list given IP addresses, IP addresses with a number of separate ballots, the mainframe is not on the list will not receive services provided by samba, this is one aspect of network security.
Printcap name designated printcap document addresses usually /etc/printcap includes the Linux printer configuration information.
Load printers to allow the use of shared printers, the default values for yes.
If the printer is printing the use of non-standard, it should be noted printer types.
Log file = /usr/local/samba/var/log.%m
Max log size = 0
Samba is above the two firms log relevant definitions. /var/log/samba/%m.log Its records on the location of documents, the catalog is not installed, the log is very different, as the definition is a document the size of the log records, the unit is KB, in the case of open-size 0.
PRESIDENT : Those against please say guests and guest accounts, which use a Linux user, as indicated by the client to connect to the definition of Samba default user account, the account must be in /etc/passwd China.
Security designated safe mode. Most users use user-level security model, the use of local samba Linux password verification documents.
Security_level security =
Samba definition of the security level, from low to high into four categories : share, user, server, domain. They correspond to the test as follows :
Safety level : not share any user can not visit a user ID and password server resources.
User:samba default configuration, required the user to access a shared resource to provide the resources necessary to verify user names and passwords.
: Server and user security level similar to that user names and passwords are handed to another server to verify such a submission to the NT server. If the submission fails, then retreated user security levels.
Domain : the existence of a network-level security requirements of the Primary Domain Controller for Windows, samba presented to the user name and password to verify it.
Behind the three-level security requires users to have an account on the Linux machine. Otherwise, the visit is not
Smb passwd file=/etc/samba/smbpasswd (smb password set up the position paper)
Username map =/etc/smbusers
=no Encrypt passwords when used expressly password verification, if it is encrypted, it is changed to yes
On a day remembered, I vowed to install any decision only source software, not rpm. Although a lot of trouble, but some help understanding the internal Linux.
First, we create a document, while configured samba, and writing guide.
Www.samba.org downloaded the latest source code package from samba, I downloaded the samba-3.0.7.tar.gz, put it under my catalog /root/lova/samba China.
Tar -zxvf samba-3.0.7.tar.gz codecs to be samba-3.0-7
Cd samba-3.0.7
README look at the cat shows, but E-wen bad, do not really understand that direct the installation of bars.
Find. -name Configure
. /source/configure Possession of the original
Cd source/
Mkdir /usr/local/samba installed to create catalog
. /configure --prefix=/usr/local/samba/ Installation to /usr/loca/samba
Make make install, named
Cd /usr/local/samba/ to look at the installation of Contents
1s
1986-1991 Judge bin include private sbin man swat var successful installation, etc. catalog and smb.conf document how not to die, then I create a
[root--/usr/local/samba]mkdir Etc.
[root--/usr/local/samba]cp ~/love/samba/samba-3.0.7/examples/smb.conf.default. /etc/smb.conf
Well look at our goals.
First, it will be a shared catalog, only time can not do any changes.
Second, there is a shared catalog, anyone can make any changes, including the addition of catalog documents, delete catalog documents.
Third, each user can see the main-menu, other users can see, we can make changes.
Fourth, there is a shared list of Group A person can do any changes to the Group B can only read, see Section C of the people.
5, posted after each user can use printers. (Without success).
Method 1 Goals 1
[root--~]cd /usr/local/samba/etc/
Backup about [root--/usr/local/samba/etc]cp smb.conf beifen avoid the error.
Laws smb.conf.
MSHOME workgroup = read your Linux host of the working group
Open sharing of security = share
Finally add in smb.conf
[read1]
Comment = read1
Path = /home/read1
Public = yes
Guest ok = yes
Writable = yes
Creating a common list
Whoami
Root
Umask
0022
Mkdir /home/read1
Cd !$
Cat "; Linux
Hi Linux
Ll /home/read1/
Total volume 4
-rw-r--r-- 1 root root 9 at 11:20 on October 24 Linux
644 vs.
Adduser nxgz; passwd !$ built users
[root--~]/usr/local/samba/bin/smbpasswd - Nxgz then the user to add samba users
Can 't load /usr/local/samba//lib/smb.conf-run testparm to Killing how wrong it seems, did not smb.conf 1986-1991 Judge not, I will add bars
[root--~]cp /usr/local/samba/etc/smb.conf /usr/local/samba/lib/
[root--~]/usr/local/samba/bin/smbpasswd Nxgz add samba-user success
New SMB password :
Password : Retype new SMB
Startsmbfilepwent_internal : file /usr/local/samba//private/smbpasswd did not exist. File successfully created.
Added user nxgz.
[root--~]service Iptables stop
Remove all chain : [established]
Delete user-defined chain : [established]
Built as the heavy chain acquiescence to the "ACCEPT" strategy : [established]
[root--~]service Network restart
[Established] is closed adapter eth0 :
Closed loop adapter : [established]
Set up network parameters : [established]
[Established] ejection ring adapter :
Activated interface eth0 : [established]
The 2-D process started samba [root--~]/usr/local/samba/sbin/smbd
[root--~]/usr/local/samba/sbin/nmbd D
To win-xp, open the computer to find addresses, import \\linux mainframe, and can be found sharing a list read successfully.
Method 2
Finally, add the following in smb.conf
[read2]
Comment = read2
Path = /home/read2
Public = yes
Read only = yes
Mkdir /home/read2; cd !$; cat "; Linux; chmod-R 777 /home/read2; creating a common list and revising the authority
Then
Iptables stop service
Service network restart
/usr/local/samba/sbin/smbd D
/usr/local/samba/sbin/nmbd D
We are not sharing in the next win-xp read2.
Smb.conf may be a problem, we have used testparm tool check.
[root--~]testparm
Bash : no input testparm : command not found a complete path.
[root--~]/usr/local/samba/bin/testparm
Load smb configure files from /usr/local/samba//lib/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[read]"
Loaded services file OK.
Server role : ROLE_STANDALONE
Press enter to see a dump of your service definitions
Read2 is not, we look at the first line, Load smb configure files from /usr/local/samba//lib/smb.conf like testpart lib/smb.conf is the tool, 1986-1991 Judge of the smb.conf etc. smb.conf and even completely different, because we increased the read2, we can cover its complex system
Cp-f /usr/local/samba/etc/smb.conf /usr/local/samba/lib/
Then
Iptables stop service
Service network restart
/usr/local/samba/sbin/smbd D
/usr/local/samba/sbin/nmbd D
Win-xp return can be found, haha, well, although its mandate for 1777, but only by the read control can delete, insert.
Goal 1 success
End /usr/loca/samba/etc/smb.conf because each revision, we have
Cp-f /usr/local/samba/etc/smb.conf /usr/local/samba/lib/
Then
Iptables stop service
Service network restart
/usr/local/samba/sbin/smbd D
/usr/local/samba/sbin/nmbd D
We can write shell
Emacs samba.sh
Cp-f /usr/local/samba/etc/smb.conf /usr/local/samba/lib/
Iptables stop service
Service network restart
/usr/local/samba/sbin/smbd D
/usr/local/samba/sbin/nmbd D
Laws End, can be activated
1, sh samba.sh
2, sh "samba.sh
3, chmod 777 samba.sh
Mv samba.sh ~/bin
Samba.sh
These three methods can be.
Objective 2.
Above remain unchanged, with the final in smb.conf
[write]
Comment = write
Path = /home/write
Public = yes
Guest ok = yes
Writable = yes
Mkdir /home/write; cd /home/write; cat ";linux; chmod-R 777 /home/write/ ;sh" samba.sh creating a common list of documents, opening authority to resume service
Under win-xp to read catalog can read, can write in to delete, add and change the original document, Goal 2 is entirely correct. Chinese us try, in the Linux open win-xp write catalog, find editing Linux, increasing Chinese and write Chinese catalog catalog creation, we can go back to normal if the outcome showed that the Chinese Linux. Linux in the normal editing can result shows that the Chinese list is a distortion to think about how to solve the problem.
In addition smb.confr the [global]
Dos charset=cp936
I added security = share charset=cp936 Unix below the
In addition win-xp opened write Chinese catalog return Linux, one can see the Chinese recognition
Goal 3.
Several samba create more users.
Adduser sambau001; passwd !$; /usr/local/samba/bin/smbpasswd - sambau001
Sambau002 increase with the above method, users sambau003
These users were su to increase Linux document and then amend the smb.conf, security = read user, please restart about this win because of the addition of users, password and the user can then input into, and can see the catalog
My home is as follows
[homes]
Comment = home
Browseable = no
Writable = yes
Valid users = %S
Create mode = 0664
Directory mode = 0775
A user with access win-xp following the creation of a document, a catalog, in addition to create a catalog documents used in the Linux users to enter their target, we can see in the paper just to create a list with 664 documents authority, competence list with 775.
Goal 3 success.
Goal 4.
Creating three groups
Groupadd sambag001; groupadd sambag002; groupadd sambag003
Usermod g sambag001 sambau001; usermod g sambag002 sambau002; usermod g sambag003 sambau003 turn three users were added to the three groups.
Mkdir share ;cd share/ ;cat "; Linux; chmod-R 777 /home/share/ open authority to control it in smb.conf
R sambag001 user group requirements, rw sambag002 group of users, groups of users no sambag003
Add the following in smb.conf
[share]
Comment = share
Path = /home/share
No public =
Valid users =sambag001,sambag002
Invalid users =sambag003
Write list =sambag002
In addition to win-xp under test success
The list can not enter.
There are valid only userd presents r authority, write the list in front; No. Well sambag001 sambag002 the user and the user can see.
[] Which is designated as the sharing inside, and the network is generally neighbors can see inside the folder's name.
As to the comment refers to the sharing of the Notes.
Sharing the path designated trails
Allow hosts and deny the hosts and set up the same way in front of the whole this is no longer mentioned.
The catalog is the designated default writeable can write.
User with all the possible use of the shared resource users, can also be usedgroup group represents all members of the group, using different items or comma separated from the ballots.
Valid users will be able to see the specified group of users and the sharing of resources.
Designated invalid users can not see the sharing of resources and the users group.
Read only read the list specified group of users and the sharing of resources.
Read and write can write specific list of users and the sharing of resources group.
Admin list can be designated to manage the sharing of resources (including literacy and competences conferred) users and groups.
Sharing of resources will give the public a specified account tourists visit the switch sometimes also called guest ok, so some configuration file and the public appeared guest ok = = yes yes in fact be the same.
Create mode to create a new document specified attributes, typically 0755.
Directory mode to specify a list of the attributes of the new building, is generally 0755.
Force include the founding documents is the main user is who. If I have a list, so that guest can write, then the guest will be deleted if I force the founding documents is mandatory user= grind is the main grind, while limiting create mask = 0755, the guest will not be deleted.
Browseable other designated users can browse through the list of the main users, of course not allowed, as no home.
When users visit the catalog is writable and read into the main catalog the documents, the value of yes, only read no competence to be home.
Xp visit to the success of Linux, try to visit some Linux xp
Use #smbclinet "\\\\nxgz\ shared catalog"
Windows can download the same as Telnet or ftp server nxgz, asking you a password, a password.
Then there smb:\>;
FOSS is unsuccessful due to the installation of the following equipment orders. --
Smbmount //test/share /pub Linux articulated Windows Contents
Mount-t smbfs -o username=WINDOWS mainframe download, and corresponding passwords //PC-NAME/SHARE-DIR /mnt/tmp password=
Smbmount //testsamba/pub pub Linux and Linux sharing
Add corresponding catalogs and users
1, add users one by one
To root user groups, adding Linux users, and set the password :
Adduser smbuser
Passwd smbuser
Samba server to the user smbuser adding users and set the password :
Smbpasswd - smbuser
2, adding the system to all users
#vi /etc/passwd (Or you do not know some of you do not have all the users deleted.)
# Cat /etc/passwd - mksmbpasswd.sh "; /etc/samba/smbpasswd (On the phone users to its Linux users going smb)
#smbpasswd Test (test users smb visit password installed)
#/etc/rc.d/init.d/smb Restart (restart samba)
3, join in
#smbadduser Customers linuxname:2000name #
Smbpasswd password for each user, using the following form : (to be Root)
Smbpasswd userid:passwd userid2:passwd2. . . . . . }} |
How Linux server configuration smba Good foundation to learn |
| |