Samba enables file sharing between Linux and win, and is excellent for in-house development of document sharing.
Installing Samba
See if Samba is installed
# Rpm-qa | grep Samba
Install Samba server and client directly via Yum
#yum-y Install samba samba-client
Samba's main configuration file is/etc/samba/smb.conf, which is mainly achieved under win through the account login Linux share, complex configuration can refer to the final address. Add a section of shared block directly after smb.conf.
[Public]
Comment = Public Files
path =/data/share/public public
= no
writable = yes
browseable = y Es
The configuration block is indented through the tab and the copy may be a space. Add a system user and add users to the Samba account
# useradd-s/sbin/nologin smbuser
# smbpasswd-a smbuser smbpasswd
command smbpasswd-a
Add user (the user to be added must be a system user)
smbpasswd
-D freezes the user, that is, the user is not logged in
SMBPASSWD-E restore users, unfreeze users, so that frozen users can use the
Smbpasswd-n sets the user's password to null. Note If you set the NO PASSWORD, to allow the user to log on to the Samba server with an empty password, the administrator must set the following parameters in the global segment of the smb.conf configuration file: null passwords = yes
Smbpasswd-x Delete User
Test configuration is correct-testparm
Test if Samba settings are correct, such as the configuration above
# testparm-s smb.conf
Load smb config files from smb.conf
processing Section ' [public] '
Loaded Services file OK.
Server Role:role_standalone
[global]
workgroup = MyGroup
Server string = Samba server Version%v
Passdb backend = Tdbsam
log file =/var/log/samba/%m.log
cups options = raw
[public]
Comment = Public Files
Path =/data/share/public
Read Only = No
Start Samba
View Samba service status, startup, and restart.
# service smb status smbd (pid 30408) is running ... nmbd (PID 30411) is running # service smb stop SHUTTING DOWN SMB services: [ ok ] shutting down nmb services:
[ ok ] # service smb start starting smb services: [ ok ] starting nmb services: [ ok  &NBSP] # service smb restart shutting down smb services: [ ok ] Shutting down NMB services: [ ok ] starting smb services: [ ok ] Starting NMB services:    [  OK  ]
Set up the Samba service to boot from
# chkconfig--list | grep SMB SMBs
0:off 1:off 2:off 3:off 4:off 5:off 6:off
# chkconfig SMB on
# Chkconfig--list | grep SMB SMB
0:off 1:off 2:off 3:on 4:off 5:on 6
: Off
Windows purge shared Records
After the success of the samba connection will be logged in the local account password, the next can be directly connected, if you need to switch account can manually delete the connection record.
View Access Records
C:\users\administrator>net use
No new network connections are logged.
State Local Remote network
--------------------------------------------------------------------------
OK \\42.121.104.209\public Microsoft Windows Network
Command completed successfully.
Clear Access Record
C:\users\administrator>net Use \\42.121.104.209\public/delete
\\42.121.104.209\public has been deleted.