I. Feasibility Analysis: 1. The company has two servers for elimination (Lenovo T100 CPU: P42.4, Memory: 512MECC hard disk: 73 GSCSI), idle. 2. I wanted to add a file server to the MSWindowsserver2003 domain controller, but I was afraid that it would not be enough. after all, I got older, so I used the Debian Linux platform and used the famous
I. Feasibility analysis:
1. The company has two obsolete servers (Lenovo T100 CPU: P42.4, Memory: 512 m ecc hard disk: 73g scsi), unused.
2. I originally wanted to use the MS Windows server2003 domain controller and file server, but I was afraid that it would not be enough. after all, I got older, so I used the Debian Linux platform and used the famous samba as the server. So I purchased a 160 GB IDE hard disk.
II. requirements:
1. each user requires authentication when logging on, and can only see their own folders, others cannot access.
2. each user has read and write permissions on his/her own files.
III. installation method:
1. basic installation of debian system
The basic installation method is similar to the previous blog. Minimize installation, that is, do not select anything in tasksel. The difference is that
Change testing (beta version) to etch (stable version). of course, the partitioning scheme is also different. below is my partitioning scheme.
/ 1G
Swap 2G
/Home The remaining hard disk space is about 150 GB.
2. install samba
Apt-get install samba smbcilent
3. configure samba
To meet my requirements, configure samba and modify several parameters.
Vi/etc/samba/smb. conf, modify several key fields, and then attach the smb. conf file.
4. add and test users
1. added system users
Command: useradd john
2. add samba users (note that samba users must be system users and their passwords can be different)
Command: smbpasswd-a john
3. restart the samba service.
/Etc/init. d/samba restart
4. test
On the MS Windows XP desktop, right-click the "network neighbor" icon and select "Search computer ",
Enter the IP address of our Samba server or the computer name (fileserver), and then click "Search". The result is as follows:
:
Linux + samba "title =" I changed the company's file server to debianLinux + samba "/>
Linux + samba "title =" I changed the company's file server to debianLinux + samba "/>
5. test results: I wrote 4.58G data to the samba Server. it took 6 minutes and I was very satisfied. However, you need to refresh the folder to see the effect when creating or deleting a folder. I am not used to it. I don't know if I can change it.
Linux + samba "title =" I changed the company's file server to debianLinux + samba "/>
5. install the remote login software SSH
Apt-get installssh to facilitate remote user management.
Attachment smb. conf file
Fileserver :~ # Cat/etc/samba/smb. conf
#
# Sample configuration file for the Samba suite for DebianGNU/Linux.
#
#
# This is the main Samba configuration file. You shoshould readthe
# Smb. conf (5) manual page in order to understand the optionslisted
# Here. Samba has a huge number of retriable options most ofwhich
# Are not shown in this example
#
# Any line which starts with a; (semi-colon) or a # (hash)
# Is a comment and is ignored. In this example we will use #
# For commentary and a; for parts of the config file that you
# May wish to enable
#
# NOTE: Whenever you modify this file you should run thecommand
# "Testparm" to check that you have not made any basicsyntactic
# Errors.
#
#====================================== Global Settings ==================== ==========
[Global]
# Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba serverwill part
Workgroup = hotel
# Server string is the equivalent of the NT Descriptionfield
Server string = fileserver
# Windows Internet Name Serving Support Section:
# WINS Support-Tells the NMBD component of Samba to enable itsWINS Server
; Wins support = no
# WINS Server-Tells the NMBD components of Samba to be a WINSClient
# Note: Samba can be either a WINS Server, or a WINS Client, butNOT both
; Wins server = w. x. y. z
# This will prevent nmbd to search for NetBIOS names throughDNS.
Dns proxy = no
# What naming service and in what order shoshould we use to resolvehost names
# To IP addresses
; Name resolve order = lmhosts host winsbcast
#### Networking ####
# The specific set of interfaces/networks to bind
# This can be either the interface name or an IPaddress/netmask;
# Interface names are normally preferred
; Interfaces = 127.0.0.0/8 eth0
# Only bind to the named interfaces and/or networks; you mustuse
# 'Interfaces' option above to use this.
# It is recommended that you enable this feature if your Sambamachine is
# Not protected by a firewall or is a firewall itself.However, this
# Option cannot handle dynamic or non-broadcast interfacescorrectly.
; Bind interfaces only = true
#### Debugging/Accounting ####
# This tells Samba to use a separate log file for eachmachine
# That connects
Log file =/var/log/samba/log. % m
# Put a capping on the size of the log files (in Kb ).
Max log size = 1000
# If you want Samba to only log through syslog then set thefollowing
# Parameter to 'yes '.
; Syslog only = no
# We want Samba to log a minimum amount of information tosyslog. Everything
# Shoshould go to/var/log/samba/log. {smbd, nmbd} instead. If you wantto log
# Through syslog you shoshould set the following parameter tosomething higher.
Syslog = 0
# Do something sensible when Samba crashes: mail the admin abacktrace
Panic action =/usr/share/samba/panic-action % d
####### Authentication #######
# "Security = user" is always a good idea. This will require aUnix account
# In this server for every user accessing the server. See
#/Usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# In the samba-doc package for details.
Security = user
# You may wish to use password encryption.See thesection on
# 'Encryption password' in the smb. conf (5) manpage beforeenabling.
Encrypt passwords = true
# If you are using encrypted passwords, Samba will need to knowwhat
# Password database type you are using.
Passdb backend = tdbsam
Obey pam restrictions = yes
; Guest account = nobody
Invalid users = root
# This boolean parameter controls whether Samba attempts to syncthe Unix
# Password with the SMB password when the encrypted SMB password inthe
# Passdb is changed.
; Unix password sync = no
# For Unix password sync to work on a Debian GNU/Linux system, the following
# Parameters must be set (thanks to Ian Kahan <
# Sending the correct chat script for the passwd program in DebianSarge ).
Passwd program =/usr/bin/passwd % u
Passwd chat = * Enter \ snew \ sUNIX \ spassword: * % n \ n * Retype \ snew \ sUNIX \ spassword: * % n \ n
* Password \ supdated \ ssuccessfully *.
# This boolean controls whether PAM will be used for passwordchanges
# When requested by an SMB client instead of the program listedin
# 'Passwd program '. The default is 'no '.
; Pam password change = no
########## Domains ###########
# Is this machine able to authenticate users. Both PDC andBDC
# Must have this setting enabled. If you are the BDC you must
# Change the 'domain Master' setting to no
#
; Domain logons = yes
#
# The following setting only takes effect if 'domain logons' isset
# It specifies the location of the user's profile directory
# From the client point of view)
# The following required a [profiles] share to be setup on
# Samba server (see below)
; Logon path =\\ % N \ profiles \ % U
# Another common choice is storing the profile in the user's homedirectory
; Logon path =\\ % N \ % U \ profile
# The following setting only takes effect if 'domain logons' isset
# It specifies the location of a user's home directory (from theclient
# Point of view)
; Logon drive = H:
; Logon home =\\ % N \ % U
# The following setting only takes effect if 'domain logons' isset
# It specifies the script to run during logon. The script must bestored
# In the [netlogon] share
# NOTE: Must be store in 'dos 'file format convention
; Logon script = logon. cmd
# This allows Unix users to be created on the domain controllervia the SAMR
# RPC pipe.The example command creates a user accountwith a disabled Unix
# Password; please adapt to your needs
; Add user script =/usr/sbin/adduser -- quiet -- disabled-password -- gecos "" % u
########## Printing ##########
# If you want to automatically load your printer list rather
# Than setting them up individually then you'll need this
; Load printers = yes
# Lpr (ng) printing. You may wish to override the location ofthe
# Printcap file
; Printing = bsd
; Printcap name =/etc/printcap
# CUPS printing.See also the cupsaddsmb (8) manpagein
# Cupsys-client package.
; Printing = cups
; Printcap name = cups
# When using [print $], root is implicitly a 'printer admin', butyou can
# Also give this right to other users to add drivers and setprinter
# Properties
; Printer admin = @ ntadmin
########### Misc ############
# Using the following line enables you to customise yourconfiguration
# On a per machine basis. The % m gets replaced with the netbiosname
# Of the machine that is connecting
; Include =/home/samba/etc/smb. conf. % m
# Most people will find that this option gives betterperformance.
# See smb. conf (5) and/usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# For details
# You may want to add the following on a Linux system:
# SO_RCVBUF = 8192 SO_SNDBUF = 8192
Socket options = TCP_NODELAY
# The following parameter is useful only if you have thelinpopup package
# Installed. The samba maintainer and the linpopup maintainerare
# Working to uninstall installation and configuration of linpopup andsamba.
; Message command =/bin/sh-c '/usr/bin/linpopup "% f" "% m" % s; rm % s '&
# Domain Master specifies Samba to be the Domain Master Browser. If this
# Machine will be configured as a BDC (a secondary logon server), you
# Must set this to 'no'; otherwise, the default behavior isrecommended.
; Domain master = auto
# Some defaults for winbind (make sure you're not using theranges
# For something else .)
; Idmap uid = 10000-20000
; Idmap gid = 10000-20000
; Template shell =/bin/bash
;
; The following was the default behaviour in sarge
; But samba upstream reverted the default because it mightinduce
; Performance issues in large organizations
; See #368251 for some of the consequences of * not * having
; This setting and smb. conf (5) for all details
;
; Winbind enum groups = yes
; Winbind enum users = yes
#==================================== Share Definitions ====================== ==========
[Homes]
Comment = Home Directories
Browseable = no
# By default, the home directories are exported read-only.Change next
# Parameter to 'yes' if you want to be able to write to them.
Writable = yes
# File creation mask is set to 0700 for security reasons. If youwant
# Create files with group = rw permissions, set next parameter to0775.
Create mask = 0755
# Directory creation mask is set to 0700 for security reasons. If you want
# Create dirs. with group = rw permissions, set next parameter to0775.
Directory mask = 0755
# Restrict access to home directories
# To the one of the authenticated user
# This might need tweaking when using external authenticationschemes
Valid users = % S
# Un-comment the following and create the netlogon directory forDomain Logons
# (You need to configure Samba to act as a domain controllertoo .)
; [Netlogon]
; Comment = Network Logon Service
; Path =/home/samba/netlogon
; Guest OK = yes
; Writable = no
; Share modes = no
# Un-comment the following and create the profiles directory tostore
# Users profiles (see the "logon path" option above)
# (You need to configure Samba to act as a domain controllertoo .)
# The path below shocould be writable by all users so that their
# Profile directory may be created the first time they log on
; [Profiles]
; Comment = Users profiles
; Path =/home/samba/profiles
; Guest OK = no
; Browseable = no
; Create mask = 0600
; Directory mask = 0700
[Printers]
Comment = All Printers
Browseable = no
Path =/var/spool/samba
Printable = yes
Public = no
Writable = no
Create mode = 0700
# Windows clients look for this share name as a source ofdownloadable
# Printer drivers
[Print $]
Comment = Printer Drivers
Path =/var/lib/samba/printers
Browseable = yes
Read only = yes
Guest OK = no
# Uncomment to allow remote administration of Windows printdrivers.
# Replace 'ntadmin' with the name of the group your admin usersare
# Members.
; Write list = root, @ ntadmin
# A sample share for sharing your CD-ROM with others.
; [Cdrom]
; Comment = Samba server's CD-ROM
; Writable = no
; Locking = no
; Path =/cdrom
; Public = yes
# The next two parameters show how to auto-mount a CD-ROM whenthe
# Cdrom share is accesed. For this to work/etc/fstab mustcontain
# An entry like this:
#
# /Dev/cd0 /CdromIso9660defaults, noauto, ro, user 0 0
#
# The CD-ROM gets unmounted automatically after the connection tothe
#
# If you don't want to use auto-mounting/unmounting make sure thmcm
# Is mounted on/cdrom
#
; Preexec =/bin/mount/cdrom
; Postexec =/bin/umount/cdrom