Install Samba records

Source: Internet
Author: User

Linux: LFS 6.1 In vmwarevm
Software Version: samba-3.0.14a.tar.bz2

Installation Process

Tar xvf samba - 3.0 . 14a . Tar . Bz2
CD samba - 3.0 . 14a \ Source
  ./ Configure -- Prefix =/ USR -- Sysconfdir =/ Etc -- Localstatedir =/ VaR -- With - Piddir =/ VaR / Run -- With - FHS -- With - Smbmount
Make
Install - V - M755 - D / VaR / Cache / Samba
Make install
MV - V / USR / Lib / Samba / Libsmbclient . So / USR / Lib
Ln - V - SF ../ Libsmbclient . So / USR / Lib / Samba
  Chmod   - V 644   / USR / Include / Libsmbclient . H
Install - V - M755 nsswitch / Libnss_win {s , Bind } . So / Lib
Ln - V - SF libnss_winbind . So / Lib / Libnss_winbind . So . 2  
Ln - V - SF libnss_wins . So / Lib / Libnss_wins . So . 2  
  If [ - F nsswitch / Pam_winbind . So]; then
Install - V - M755 nsswitch / Pam_winbind . So / Lib / Security
Fi
Install - V - M644 ../ Examples / SMB . Conf . Default / Etc / Samba
Install - V - M644 ../ Docs /*. PDF / USR / Share / Samba
CD ../..
Rm - RF samba - 3.0 . 14a

Okay, it's finished. Test smbmount.
Because I use a Linux system installed on a virtual machine, I can share a directory in windows on the host. The shared directory permission is specified as a Windows account, and then

Mkdir ~ /Win_share
Smbmount // host_ip/my_1__dir ~ /Win_share-o "username = XXXX, password = yyyyy"

Failed. The/etc/samba/smb. conf file is not displayed.
Check the installation process. When we copied the smb. conf. default file earlier, the. Default extension was not removed.
CP/etc/samba/smb. conf. Default/etc/samba/smb. conf
Smbmount is successful. (You do not need to configure the content of the smb. conf file, which is required by the SMB server ).

Well, now you can easily access files from other systems.

Next, configure the smb service.

Modify the content in/etc/samba/smb. conf and modify it according to the comment in the file.
Here is a relatively simple method, configure as follows
[Homes]
Comment = Home Directories
Path = % H
Browseable = Yes
Writable = Yes
Valid users = % s
Create mode = 0600
Directory mode = 0700
Locking = No

Replace % s with the System user name, and % H with the corresponding user home directory.
Users in different Linux systems are used for access, and the system is automatically set as the user's home directory, for example, crazywill user, access \ LFS-Linux-IP \ crazywill \ and \ LFS-Linux-IP \ homes \ is equivalent to the/home/crazywill/directory in Linux, permission to all files in the user's own directory.

After modification,
Smbd-d
Nmbd-d start
PS-Aux | grep SMB
Smbd process running is not found

It is suspected that the smb. conf configuration is incorrect.
Testparm
Check Configuration File Content

It seems no problem.
Check the SMB status and log files again.
Smbstatus

CAT/var/log/samba/smbd. Log
Check logs
[23:12:37, 0] smbd/server. C: Main (798)
Smbd version 3.0.14a started.
Copyright Andrew tridgell and the Samba team 1992-2004
[23:12:37, 0] printing/pcap. C: pcap_cache_reload (149)
Unable to open printcap file/etc/printcap for read!
Cannot read/etc/printcap File
Check whether the file exists in the current environment because no printer is installed. First, create an empty file for it.
Echo "">/etc/printcap

Start again, still failed, check the log
[23:18:11, 0] smbd/server. C: Main (798)
Smbd version 3.0.14a started.
Copyright Andrew tridgell and the Samba team 1992-2004
[2006/08/10 23:18:11, 1] AUTH/auth_util.c: make_server_info_sam (840)
User nobody in passdb, but getpwnam () fails!

The user's nobody has a problem,
Check if the user does not exist in/etc/passwd. Add the user and start the user again.
Run
Smbpasswd-x nobody
Deleting the nobody User Failed.

It's a bit confusing. After repeated operations, the operation was successful and I don't know where the problem is.

After the nobody is completed, the smbd process is successfully started, and the check log shows.
Celebrate.

Run the smbclient command to check whether the samba configuration is normal.

Smbclient-l localhost-u crazywill
Test connection
Prompt to enter the password, enter the password of the Linux local account crazywill, error.

Check again and finally find that you need to run
Smbpasswd-A crazywill
Set the password of the SMB Logon user crazywill

Then the smbclient test is normal,
Use Windows to connect \ LFS-Linux-IP \ crazywill
Enter the user name crazywill and the password you just set.
Normal Login

The directory and file are successfully added and modified.

Yeah .....

 

 

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.