How to configure SAMBA in LINUX8.0 (2)

Source: Internet
Author: User
Article Title: how to configure SAMBA in LINUX8.0 (2 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Modify the registry on win9x
WinNT: OHKEY_LOCAL_MACHINE \ SYSTEM \ Currentcontrolset \ Services \ Kdr \ Parameters
Win98: HKEY_LOCAL_MACHINE \ SYSTEM \ Currentcontrolset \ Services \ Vxd \ vnetsup
Win2000: HKEY_LOCAL_MACHINE \ SYSTEM \ Currentcontrolset \ Services \ LanmanWorkstation \ Parameters
Append the key value here: the key name EnablePlainTextpasswd, the value type is DWORD, and the value is 1. this is mainly because samba cannot restore the encrypted password, making registration unsuccessful. after modification, you can. Click "network neighbor" to add NETBEUI protocol, TCP/IP protocol, and Microsoft network users. If DNS is used, enter the IP address of the DNS. Click a user in the control panel to add a user existing in Linux. keep the user and password consistent with those in Linux. restart the computer and log on to the Linux server.
Execute netstat? A 192.168.7.148 (or host name)
Run
Smbclient? L // server
Smbclient \ server \ shared directory
Can access win9x resources, but cannot copy.
Create a directory/mnt/smb and execute
Smbmount \ server \ shared directory/mnt/smb
Attackers can access win9x resources and execute cp commands.
Smbumount/mnt/smb mount point failed.
If you want to see win9x after Linux is started, you must do the following:
Configure the/etc/rc. d/init. d/smb script. the configuration file is as follows:
#! /Bin/sh
#
# Chkconfig:-91 35
# Description: starts and stops the samba smbd and nmbd daemons \
# Used to provide SMB network services
#
# Pidfile:/var/run/samba/smbd. pid
# Pidfile:/var/run/samba/nmbd. pid
# Config:/etc/samba/smb. conf
# Source function library
If [-f/etc/init. d/functions]: then
./Etc/init. d/functions
Elif [-f/etc/rc. d/init. d/functions]: then
./Etc/rc. d/init. d/functions
Else
Exit 0
Fi
# Avoid using root's TMPDIR
Unset TMPDIR
# Source networking configuration
./Etc/sysconfig/network
If [-f/etc/sysconfig/samba]: then
./Etc/sysconfig/samba
Fi
# Check that networking is up
[$ {NETWORKING} = "no"] & exit 0
# Check that smb. conf exists
[-F/etc/samba/sb. conf] | exit 0
# Check that we can write to it... So non-root users stop her
[-W/etc/samba/smb. conf] | exit 0
RETVAL = 0
Start (){
Echo? N $ "starting SMB services :"
Daemon/usr/sbin/smbd? D
RETVAL =$?
Echo
Echo? N $ "starting NMB services :"
Daemon/usr/sbin/nmbd? D
RETVAL2 = $?
Echo
[$ RETVAL? Eq o? A $ RETVAL 2? Eq o] & touch/var/lock/subsys/smb | \
RETVAL = 1
Return $ RETVAL
}
Stop (){
Echo? N $ "shutting down SMB services :"
Killproc/usr/sbin/smbd
RETVAL =$?
Echo
Echo? N $ "shutting down NMB services :"
Killproc/usr/sbin/nmbd
RETVAL2 = $?
[$ RETVAL? Eq 0? A $ RETVAL2 eq 0] & rm? F/var/lock/subsys/smb
Echo ""
Return $ RETVAL
}
Restart (){
$0 stop
$0 start
RETVAL =$?
}
Reload (){
Echo? N $ "Reloading smb. conf file :"
Killproc? HUP/usr/sbin/smbd
RETVAL =$?
Echo
Return $ RETVAL
}
Rhstatus (){
Status/usr/sbin/smbd
Status/usr/sbin/nmbd
RETVAL =$?
}
Case "$1" in
Start)
Start
::
Stop)
Stop
::
Restart)
Restart
::
Reload)
Reload
::
Status)
Rhstatus
::
Condrestart)
[-F/var/lock/subsys/smb] & restart |:
::
*)
Echo $ "Usage: $0 {start | stop | restart | reload | status | condrestart }"
Exit 1
Esac
Exit $?
Then execute
Chmod 700/etc/rc. d/init. d/smb
Chkconfig -- add smb
Chkconfig -- level 345 smb on
Configure the/etc/pam. d/samba file to add:
Auth required/lib/security/pam_pwdb.so nullok shadow
Account required/lib/security/pam_pwdb.so
Configure the/etc/logrotate. d/samba file
/Var/log/samba/log. nmdb {
Notifempty
Missingok
Postrotate
/Usr/bin/killall? HUP nmbd
Endrotate
}
/Var/log/samba/log. smbd {
Notifempty
Missingok
Postrotate
/Usr/bin/killall? HUP smbd
Endrotate
}
  
  
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.