How to set up Samba servers, use user sharing methods [Repost]

xiaoxiao2021-03-06  56

One theory: In Windows, we all know the network neighbors, which is the way Windows shared resources. Linux Write Windows Interviews and Shared Resources Use Samba Services, in fact, I think it is more like a software. Windows and Linux via Samba, can share resources with each other, and the relationship between the server and the client. For example, when we doing a Windows operating system, to access files with Linux systems, the Windows should be a client, and Linux is a server; if Linux's machine is accessible to Windows, the file is available, and the use of Windows Print service, you should say that Windows is a server, and Linux is a client. Note: 1. If you can't join Linux shares under Windows, you may appear on your account, you want to build an identical user on Linux and Window machine, the password is also the same. Otherwise you cannot access it. 2. If you can find Linux sharing if you are in Windows network neighbors. We have to add it to the network neighbor. The host name of the Samba to // Linux is also the / shared name defined in NetBIOS Name. This is said that you may not understand the young brother. I am not very professional. Ah. . . Please read the // linsir01 / win02 in this post, and // linsir01 / month; // linsir01 / win03. 3. To add relevant protocols in Windows; add a network protocol to join both IPX / SPX and NetBeui. Operating environment: three machines, two WIN2000; one is RH80. 1. Whether Samba is installed in the system; this is also an operation step of installing other software: Note: Log in in root, or execute with root privileges; RPM -QA | grep sambasamba-2.2.5-10samba-swat-2.2.5-10samba-circon-2.2.5-10samba-client-2.2.5-10 If there is no three installation packages appear, we must These packages are displayed in the disc. For example, we are temporarily placed in the / TMP directory. Then execute: # rpm -ivh samba * .rpm --nodeps --force, then we judge, whether the Samba service has started, if not, we have to open. Generally speaking, Samba will not start in the system default. But we should also know how to check if this service is started, this is the process of our operation. Use View Process Command: #ps -aux | grep Smb here, we must explain a little, why don't we need #ps -aux | grep samba command, you may understand below, you can remember it now. Not what, because the service of the system is SMB, not Samba, Samba is just a name. If you use the command to view the process, the second line appears. Just open the Samba service, if there is no appearance, it is not open. #ps -auot | Grep Smbroot 1719 0.0 0.3 4916 1820? s 08:21 0:00 SMBD-DROOT 1849 0.0 0.1 4776 628 PTS / 1 s 08:48 0:00 Grep SMB 3, open Samba service; if we don't open Samba services, we should open, system services, and general open mode in the following two ways.

1. Use the setup command to open, when the #setup is executed, there is a System Serverices, then move the upper and lower keys of the keyboard to select the [System Serverices] item, then add the SMB and SWA, add a * number, indicate Already selected, it means to automatically launch these two services. Or use a more direct approach to enter the [System Serverices] selection box. The two commands used in the above explanation are: #setup or #ntsysv in this way, just open, but if not restarted, Samba's services cannot be run, we also use the command to execute, let the machine do not restart In the case of executing the Samba service, in general, the command we have to operate is in the /etc/rc.d/init.d/ directory, you want to run in the following way. # /etc/rc.d/init.d/smb start uses the above command, if you can see the following prompt, you have launched the Samba. Start SMB Service: [OK] Start NMB Service: [OK] Of course, you can use the following way, but go to /etc/rc.d/init.d/ directory to see it, see it What, anything is a rookie, you can't look at it. #CD /etc/rc.d/init.d/ Then execute the #. / SMB Start, then how do you stop Samba's service? Then, stop; how to restart the Samba server, then RESTART If we are in the /etc/rc.d/init.d directory, we will perform #. / SMB Stop #. / SMB RESTART if not / etc / rc. In the D / Init.D directory, we must implement this, and have already said. # /etc/rc.d/init.d/smb stop # /etc/rc.d/init.d/smb restart2. Run the following commands Open # redhat-config-services under x and then select SMB and SWAT , Then save it. This is relatively simple. If you are in the SMB, check it, then start. This will open the SMB service. Open the service and start, we still have to use the View Process command to see if the Samba service is running. #ps -aux | grep smb If you still don't have the following line, I don't think it is possible. Ah. . . . . Root 1719 0.0 0.3 4916 1820? s 08:21 0:00 SMBD -D 3 The file manager is on. Enter 127.0.0.1:901 in the address bar, a prompt box will appear [swat@127.0.0.1: 901] Enter the root username and password under the username to enter the graphical setup interface, which is relatively simple. 1] Click [Global] that, come out to let us set the options. As long as you set this right, if you don't know how to understand Samba, it is recommended not to change other things. If you do it in front of me, put the SMB.conf file back up, then you change it. . what. . There is no mistake, and we will restore it. . Base OptionsClient Code Page 936 This will display the Simplified Chinese user group name. [Workgroup] This is the name of the working group in [Windows "in the network neighbor, this I use MSHOME, because I also set another two computers in this working group.

[NetBIOS Name] This is the host name that appears in the network neighbor, I set up Linsir01, which is also available by default. What appears is a true host name for Linux. [Security], set to USER [Encrypt Passwords] Set to Yes2] Click [Shars], look at it. This is also more important, I still say a few more attention. In fact, we are more simple in the local area network. Simple settings will be set. Click [Choose Share], there is an option for [Homes]. click. . . then. . . . Look at it. . Look at it and the following is almost the same, it doesn't have to change what it is, and you can understand it. . This option may not write to the Guest Account Nobody by default. Valid users% Sread Only YESGUEST OK NO3] Creat Share This is to create a shared directory and personal directory, and some brothers may have a bit unsubstant, why do you say this? ? Step by step. . . . . A. We created a Win02, on the edge of the [CEATE share], there is a space. Ah. . . Maybe you know, write a Win02, then press [CREATE Share] Comment Win02Path / Home / Win02UserName Win02Guest Accoun NobodyValid Users Win02Read Only Noguest OK NobrowSeable YESAVAILABLE YESB. Create Win03 with the same approach, and the directory is also / home / Win03c. Then we create a directory that all users can see shared, that is, all users can write, read, execute. I just used this directory to do the base of Windows Machine software installed. what. . . We still follow step A, enter Share on [Create Share]. For the name, we still don't use too long, otherwise the test is not available, may be up to 8 bytes, so I use the most Simple. Point until. Comment Win and Linux SharePath / ShareGuest Accoun NobodyRead Only No Guest OK YES Browseable YESAVAILABLE YES This is OK. . . About printing, printers on Linux machines, or let you study. I have been installed, but Windows prints things, always messing up. So here I don't say how to set it. I succeeded, supplement it. 4] test configuration file are correct [root @ linuxsir01 root] # testparmLoad smb config files from /etc/samba/smb.confProcessing section "[homes]" Processing section "[printers]" Processing section "[share]" Processing section " [Win03] "Processing Section" [Win02] "Loaded Services File Ok.Press Enter to See a Dump of Your Service Definitions If there is, it is almost, if there is a warning, maybe problems appear in [Share] In that step, maybe the name is too long, don't exceed 8 bytes.

Otherwise, 5] restarted SMB [root @ Linuxsir01 root] # /etc/rc.d/init.d/smb restart Turn SMB service: [OK] Close NMB service: [OK] Start SMB service: [OK] start NMB service: [OK] If you are not successful, try again, or find a problem with the formulation of the file. four. Break the user and password of the system, and the password of the SMB. 1. Create a system user [root @ Linuxsir01 root] # UserAdd Win02 [root @ Linuxsir01 root] # UserAdd Win032. Create a system user password [root @ Linuxsir01 root] # userpasswd Win02 Then just enter the password. . . This should be simple, there is no difficulty. For example, we use otimsinm [root @ Linuxsir01 root] # userpasswd Win03 this is also the same. . Fives. Create a Win02's Win03 username on the SMB password. 1] Generate password file [root @ Linuxsir01 root] # cat / etc / passwd | mksmbpasswd.sh> / etc / samba / smbpasswd2] Change password file, we have to remove all users other than Win02 and Win03. Leave two lines of WIN02 and WIN03. 3] Create a Win02 Win03 user's SMB password, password to be the same as the password created by the system username. For example, we say otimsinm. [root @ Linuxsir01 root] # SMBPASSWD WIN02NEW SMB Password: Enter otimsinm here. We use the same way to create a Win03 SMB password. The following work will be the set of Windows machines, which is relatively simple. 4] We change the permissions of / share directory. Let all users can read and write and execute [root @ Linuxsir01 root] # chmod 777 / share, of course, this is an unsafe method, if you want to limit the permissions, you can try it, you will understand. . . six. Windows machine settings. 1] Create user and password under Windows. Because we set up the user sharing method in [Global], that is, use the Windows user name to verify. It is the case that Windows must set up a completely identical user of the Linux machine, and the password must also be consistent. This way is Samba Password Service Verification, we have created a system username and password in front of Win02 and Win03 on Linux, and also created a SMB password. So we have to create two users on the Windows machine in this step. I said this, I don't know if I can understand, the working group, we also use MSHOME. Create two users on the Windows machine. If there are two machine Windows machines, it is too good, one one. Ah. . . . The password is also the same as Win02 on the Linux machine. Remember, otherwise it is verified. The computer is actually obedient, and step by step is OK. 2] On Windows machine, add a network protocol to join both IPX / SPX and NetBeui. This should be simpler. . . 3. Share the disk or folder on the Windows machine. This is also relatively simple. Seven. Operate the following command on Linux machine, see each machine 1. Let's first check the SMB of the Linux server. It is best to view it with IP. . . .

[Root @ linuxsir01 root] # smbclient -L 192.168.0.1added interface ip = 192.168.0.1 bcast = 192.168.0.255 nmask = 255.255.255.0added interface ip = 192.168.0.2 bcast = 192.168.0.255 nmask = 255.255.255.0Password: in Here, we will press two times. . Don't add a password. Anonymous login success, = [mshome] OS = [UNIX] server = [Samba 2.2.5] sharename type comment ------------ ------- Homes Disk Home Directoriesshare Disk Win Linux shareepsonc40 Printerwin03 Diskwin02 Disk win02 homeIPC $ IPC IPC Service (Samba Server) ADMIN $ Disk IPC Service (Samba Server) Server Comment --------- ------- LINSIR01 Samba ServerLINUXSIR02Workgroup Master ----- ---- ------- MSHOME LINSIR01 If you see the bottom line on Linux machine, it may be a bit wrong. Because there is no Linsir01 set in [Global] in sharing, sharing is generally not successful. I was following the case of a machine to see the windows; [root @ linuxsir01 root] # smbclient -L 192.168.0.8added interface ip = 192.168.0.1 bcast = 192.168.0.255 nmask = 255.255.255.0added interface ip = 192.168.0.2 bcast = 192.168.0.255 nmask = 255.255.255.0session request to 192.168.0.8 failed (Called name not present) session request to 192 failed (Called name not present) Password: Anonymous login successfulDomain = [MSHOME] OS = [Windows 5.0] Server = [Windows 2000 LAN Manager] ShareName Type Comment ------------ ------ Error Returning Browse List: NT_STATUS_ACCESS_DENIEDSERVER Comment ------------- --LinuxSir02linuxSir03Workgroup Master --------------- MSHOME LinuxSir03 specifically explained what, if you don't understand, check MAN or other information. I will slowly add it in this file. . 2. We are in Windows's network neighbor. Add a network neighbor. The premise is to log in in a Windows machine with Win02 users. then. . . . Enter // linsir01 / win02 in the location of the network neighbor. This should be okay. . . Win03. Also the same. . . Also must be logged in in WinDOWS machine. Enter the username and password, then, next time, we will no longer need to enter the username and password again, this is in Win2000; if in Win98, because the system is just prompting the password.

If the username and password, the user's Win02 or Win03 user is not allowed, there is no way to log in. Of course, the user Win02 of Windows 98 wants to view the contents of the Linux machine WIN02 folder, and must be logged in in WinDOWS. Visit Linux's Share folder, we also entered in the network neighbor // linsir01 / share This we have already said before, and everyone has read and write and execute permission. That is to say completely. Windows or Linux users, no matter who has permission to operate any files here. That Linux machine How to view the shared file on the Windows machine. I have time to write again, but I still use the following software. . Linneighborhood-0.6.2-1.i386.rpm This package is compiled under RedHat 8.0. There should be no problem in redhat. After downloading, unzipped and install #tar zxvf l * .tar.gz # rpm -ivh Linneighborhood-0.6.2-1.i386.rpm run command, should be #Linneighborhood, you should click on the mouse, set it. There is not difficult to try it. It may be not very rigorous in front, it may be not right. Please refer to you. Thank you. Attachment: Linneighborhood.tar.gz

转载请注明原文地址:https://www.9cbs.com/read-115443.html

New Post(0)