Solution to SMB related issues

xiaoxiao2021-03-06  97

1. Provide file / directories and printer sharing by linux to Windows.

After running on the Samba on the Linux server, Linux is equivalent to a file and print server, to Windows and Linux.

Samba customers provide documentation and print services. Work in sharing mode or two methods in user mode (Security = Share)

OR security = user), which is all common problems. Environment: Redhat Linux 6.x

1. When sharing mode, from the Windows 98 client cannot see the server from the online neighbor, or you can't click to enter the shared resource.

Say the password is wrong, etc.

a. Nothing to take a guest account = pcGuest front annotation symbol

b. No guest account pcguest (#useradd pcguest)

c. Windows 98 The encrypted password is transmitted by default, and the Enable Samba encryption password is not available in /etc/smb.conf.

Or you can also edit the Windows 98 registry, let it send a text password (not recommended)

2. Define a fully writable shared directory in /etc/smb.conf, but cannot be written during actual operation.

a. Especially note: Linux itself files and directory permissions are always greater than the permissions defined by Samba, let a shared resource directory

It can be written, first to ensure that the directory under Linux can be written accordingly, this is a premise.

3. How to add username and password protection on a shared directory in sharing mode?

a. See the shared resource definition example of the following:

Security = Share

UserName Map = / etc / smbusers

Log file = /VAR/LOG/SAMBA/LOG.%M

Max log size = 50

Socket options = tcp_nodelay

Client code Page = 936

OS level = 40

Local Master = YES

preferred master = yes

Domain master = yes

Guest account = pcguest

Encrypt passwords = yes

SMB Passwd file = / etc / smbpasswd

[Sales]

Comment = Test Folder

PATH = / Sales / Training

Guest ok = no

Writable = yes

Valid users = @sales

Write List = @sales

In the above example, we define security = Share and Samba Encrypt Password, shared directory name SALES

Not guest accessible, users who need to be in the Sales group can access at the same time can also be written, of course, under Linux, to ensure

/ Sales / Training directory can be written by group Sales, so later

Define your Windows Logon user name as a username in Group Sales, then double-click on the online neighbor

You will prompt your password when Sales, which is the password you defined on the Samba server, in the above example

Username and password are stored in file / etc / smbpasswd, of course, you must have a system user name in advance in / etc / passwd.

4. Windows users often browse to the name of the Samba server in the online neighbor.

a. Windows online neighbor service is a very unreliable service, which is unreliable, which is caused by many factors. b. A reliable solution is to use the 'Find' - 'Computer' - the host name that is entered into the Samba server.

Note To make sure you don't cancel the login when you start Windows.

c. You can also use NET USE commands at the DOS window: such as C: / Net Use M: // SambaserverName / ShareSourceName

5. Server-end Test Configuration Tool

a. Whether there is a corresponding syntax error in the TestParm detection configuration file after configuring /etc/smb.conf

b. After the Samba service, use SMBSTATUS to report users to use and log in.

c. Once you have changed the configuration file, run the /etc/rc.d/init.d/smb restart reread configuration file

Second. Use Linux Samba Server on Linux Clients

1. Use SMBClient on Linux client

a. List all available shared resources on computer 192.168.100.1:

SMBCLIENT -L 192.168.100.1

If you ask your password, you will enter the bus directly.

You can also use the name as:

SMBCLIENT -L SH3

If you don't know the IP address of SH3, you can also use it.

SMBCLIENT -L SH3 -I 192.168.100.1

b. Connect a share resource Sales on Samba Server 192.168.100.1 as a user

SMBClient //192.168.100.1/sales -u jephe

When prompted the password, enter the password, you can also hit the password to separate the command line.

To: SMBClient //192.168.100.1/sales -u jephe% Password

The prompt is SMB: /, like FTP.

You can also use the name as:

SMBCLIENT // sh3 / sales -i 192.168.100.1 - jephe

You can also use '/' symbols, your shell may filter to special symbols /, then write this way

#smbclient sh3 // Sales

2. Find the NetBIOS name through the IP address

a. Used under Windows

C: / nbtstat -a 192.168.100.1

If you know the NetBIOS name, you can use the following command to know which services provide a machine

C: / nbtstat -a hydra

b. Used under Linux

#NMBlookup -a 192.168.100.1

In a network segment, you can use the following command to detect which hosts are providing Samba sharing services:

#NMBLOOKUP -D 2 '*' or #NMBLOOKUP -B 192.168.100.255 '*'

Check if a machine in other network segments provides Samba services

#NMBLOOKUP -A 192.168.15.48

However, it is not possible to use #nmblookup -b 192.168.15.255 '*', because the general router and Linux dual-host are not forwarded directly to the subnet.

3. NetBIOS over TCP / IP use protocol and port number

a. A total of three NetBIOS services

NetBIOS-NS 137 / UDP (Most) and 137 / TCP

NetBIOS-DGM 138 / UDP (Most) and 138 / UDP

NetBIOS-SSN 139 / TCP

The PC application on the B.Windows machine communicates with each other through the NetBIOS name between different machines.

c. Each time when the Windows machine is started, it issued a 137 / UDP broadcast to the entire network segment, and registered to a

The main browser in the working group registers the NetBIOS name, two to confident that the entire subnet is not the same name

d. The browsing list established in the online neighbor is just a list. It doesn't matter if you can't see it. You can also use the computer to find, NET USE commands, etc.

e. It is not possible to browse online neighbors after the machine in the same network segment or the PPP server dialing to the LAN.

This is because broadcasts in the subnet are not forwarded by the serial lines and routers.

f. How to use the Samba server on the LAN after dialing the PPP server on the LAN?

<1> Edit C: / Windows / Lmhosts in a Windows Directory

Such as: 192.168.11.3 sh3 #pre #dom: sales

Execute nbtstat -r to enable, do not need to restart Windows

<2> You must log in to Windows, if you are user mode Samba, you should choose Windows NT login

<3> Other settings are the same as the machine on the LAN

<4> After the dial is established, find the 'computer' function positioning resource

<5> Now you can use the directory and printers on the remote server.

The machine can also refer to this practice in different network segments, or use the PLUG-GW agent TCP / 139 to access Samba on another network segment.

server.

4. Easy ways to use Microsoft FTP servers. Ftp.microsoft.com

a. Add 'ftp' to lmhosts file

198.105.232.1 ftp #pre

Run NBTSTAT -R

b. Net view // ftp

c. NET USE G: // ftp / data

d. Dir g:

5. Use of smbmount

a. #smbmount //192.168.100.1/pub / mnt / sh3 -u jephe% Password

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

New Post(0)