Samba server settings

Source: Internet
Author: User
Samba server settings-Linux Enterprise Application-Linux server application information. For details, refer to the following section. 1. Files/directories and printer sharing are provided to windows by Linux.
After Samba runs on a Linux server, Linux is equivalent to a file and print server.
Dows
And Linux
Samba customers provide file and print services. The two methods that work in the shared mode or user mode are more common (
Secu
Rity = share
Or Security = user. Environment: Redhat Linux 6.x
1. In shared mode, the windows 98 client cannot view the server from the network neighbors or click
Enter
Shared resources
The password is incorrect.
A. The comment symbol before the line guest account = pcguest is not removed.
B. You have not created a guest account pcguest (# useradd pcguest)
C. windows 98 sends the encrypted password by default, while/etc/smb. conf does not have the enable Samba encrypted password.

Alternatively, you can edit the windows 98 registry to send a text password (not recommended)
2. A fully writable shared directory is defined in/etc/smb. conf, but cannot be written in actual operations.
A. Note that the file and directory permissions of LINUX are always higher than those defined by SAMBA.
Resource Sharing
Source directory
It can be written. First, ensure that the directory can be written by the corresponding user in LINUX. This is the premise.
3. In shared mode, how does one add a user name and password to a shared directory?
A. Let's take a look at the following shared resource definition example:
Security = SHARE
Username map =/etc/smbusers
Log file =/var/log/samba/log. % m
Max log size = 50
Socket options = TCP_NODELAY
Client code pages = 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 defined security = share and samba encrypt password, shared directory
Name sa
Les
It is not accessible by guest users. It must be accessible and writable by users in the sales group. Of course, in Linux
Face to face
Guarantee
The/sales/training directory can be written by the group sales.
Define your windows logon (not NT domain login) user name as the user name in the sales group, and then on the Internet
Neighbors
Double-click
The password will be prompted during sales. It is the Samba encrypted password you have defined on the samba server.
Example
Medium
The user name and password pair are stored in the file/etc/smbpasswd.
Swd
.
4. windows users often cannot browse Samba server names in their network neighbors.
A. windows's network-based neighbor service is a very unreliable service, and the browsing list it creates is not reliable.
Factors
Cause.
B. A reliable solution is to directly use 'lookup '-'computer'-to input the samba server's host name.
Search
.
Make sure that you did not cancel the logon when windows is started.
C. You can also use the net use command in the DOS window, for example, c: net use m: \ sambaservernamesharereso.
Urce
Name
5. server-side test configuration tool
A. After configuring/etc/smb. conf, run testparm to check whether the corresponding syntax error exists in the configuration file.
B. Use smbstatus to report user usage and logon status after Samba is started.
C. After changing the configuration file, run/etc/rc. d/init. d/smb restart to re-read the configuration file.
2. Use the Linux Samba server on a Linux Client
1. Use Smbclient on Linux Client
A. list all available shared resources on the computer 192.168.100.1:
Smbclient-L 192.168.100.1
If you ask for a password, press Enter.
You can also use the following name:
Smbclient-L sh3
If you do not know the sh3 IP address, it is also available
Smbclient-L sh3-I 192.168.100.1
B. Share Resource sales connected to Samba server 192.168.100.1 as a user
Smbclient // 192.168.100.1/sales-U jephe
Enter the password after prompting the password, or separate the password on the command line with "% ".
Smbclient // 192.168.100.1/sales-U jephe % password
The prompt is smb:, just like FTP
You can also use the following name:
Smbclient // sh3/sales-I 192.168.100.1-U jephe
You can also use the \ symbol. Your SHELL may filter out the special symbol, so write it like this.
# Smbclient \ sh3 \ sales
2. Search for netbios names by IP Address
A. Use it in windows
C: nbtstat-A 192.168.100.1
If you know the netbios name, you can use the following command to find out which services are provided for a certain machine.
C: nbtstat-a hydra
B. Use it in Linux
# Nmblookup-A 192.168.100.1
In a CIDR Block, use the following command to check which hosts provide the samba sharing service:
# Nmblookup-d 2 * or # nmblookup-B 192.168.100.255 *
Checks whether a machine in another network segment provides the samba service.
# Nmblookup-A 192.168.15.48
However, # nmblookup-B 192.168.15.255 * cannot be used, because normal routers and Linux dual-host hosts do not forward data.
Subnet
Broadcast directly.
3. netbios over TCP/IP protocol and port number
A. There are three netbios services in total.
Netbios-ns 137/udp (majority) and 137/tcp
Netbios-dgm 138/udp (majority) and 138/udp
Netbios-ssn139/tcp
B. PC applications on windows machines communicate with each other through the netbios names of different machines.
C. Each time when a windows machine is started, it sends a 137/udp broadcast to the entire network segment to register
The main browser in the Working Group Registers the netbios name.
D. The browsing list created in the network neighbor is only a list, and it does not matter if it is invisible. You can also use

Computer Search, net use command, and so on to communicate with other computers, share files and printers
E. browsing of network neighbors is not possible on machines that are not in the same network segment or after dialing to a PPP server on the LAN
.
This is because broadcasts in the subnet are not forwarded by serial lines and routers.
F. How can I use the Samba server on the LAN after dialing to the PPP server on the LAN?
<1> edit c: windowslmhosts in the windows directory
For example: 192.168.11.3 sh3 # PRE # DOM: sales
Run nbtstat-R to enable it, and you do not need to restart windows.
<2> You must log on to windows. If samba is in user mode, you should select windows NT to log on.
<3> other settings are the same as those on the LAN.
<4> after dialing to establish a connection, find the 'computer 'function to locate the resource
<5> now you can use directories and printers on the remote server.
You can also use the plug-gw Proxy tcp/139 port to access another network segment.
On
Samba
Server.
4. A simple method for using Microsoft FTP server. 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: \ ftpdata
D. dir g:
5. Use of smbmount
A. # smbmount // 192.168.100.1/pub/mnt/sh3-U jephe % password
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.