Académique Documents
Professionnel Documents
Culture Documents
CONFIGURINGLINUXSAMBASERVER
Youaremostwelcometothispost.
Reallythankstoyouforyourinterestinthistopics.:)
SometimesyouneedtoconfigureFTPserverfortransferringfile.TherearesomanyFTPclientforLinuxOS.
hereinthispost,FTPclientofCentOS/RedHatismainlydiscussed.Soletstrytheseprocess.
CONFIGURINGLINUXFTPSERVER:SAMBASERVER
[ece@localhostDesktop]$su
Password:
Lastlogin:WedMay1122:45:08EDT2016onpts/0
[root@localhost~]#yuminstallsambasambaclientcifsutilsy
Loadedplugins:fastestmirror,langpacks
base|3.6kB00:00
extras|3.4kB00:00
updates|3.4kB00:00
Loadingmirrorspeedsfromcachedhostfile
*base:centos.excellmedia.net
*extras:mirrors.nwsuaf.edu.cn
*updates:centos.ustc.edu.cn
Packagesamba4.2.106.el7_2.x86_64alreadyinstalledandlatestversion
Packagesambaclient4.2.106.el7_2.x86_64alreadyinstalledandlatestversion
Packagecifsutils6.27.el7.x86_64alreadyinstalledandlatestversion
http://whilenetworking.com/2016/06/19/con guring-linux-samba-server/
1/6
15/11/2016
Nothingtodo
[root@localhost~]#rpmqa|grepcifsutils
cifsutils6.27.el7.x86_64
[root@localhost~]#groupaddsambausers
[root@localhost~]#mkdirp/sambashare
[root@localhost~]#echowelcometosambasharezonebywhilenetworking.com>/sambashare/welcome
[root@localhost~]#chgrpsambausers/sambashare
[root@localhost~]#chmod775/sambashare
[root@localhost~]#lsld/sambashare
drwxrwxrx.2rootsambausers20May1123:08/sambashare
[root@localhost~]#useradds/sbin/nologinGsambausersuser1
[root@localhost~]#useradds/sbin/nologinGsambausersuser2
[root@localhost~]#useradds/sbin/nologindep
[root@localhost~]#smbpasswdauser1
NewSMBpassword:
http://whilenetworking.com/2016/06/19/con guring-linux-samba-server/
2/6
15/11/2016
RetypenewSMBpassword:
Addeduseruser1.
[root@localhost~]#smbpasswdauser2
NewSMBpassword:
RetypenewSMBpassword:
Addeduseruser2.
[root@localhost~]#smbpasswdadep
NewSMBpassword:
RetypenewSMBpassword:
Addeduserdep.
[root@localhost~]#vim/etc/samba/smb.conf
[root@localhost~]#nano/etc/samba/smb.conf
[root@localhost~]#testparm
Loadsmbconfigfilesfrom/etc/samba/smb.conf
rlimit_max:increasingrlimit_max(1024)tominimumWindowslimit(16384)
Processingsection[homes]
Processingsection[printers]
Processingsection[Project]
set_variable_helper(yesuserwriteaccess):valueisnotboolean!
Errorloadingservices.
[root@localhost~]#setenforce0
http://whilenetworking.com/2016/06/19/con guring-linux-samba-server/
3/6
15/11/2016
[root@localhost~]#systemctlrestartsmb.service
.
[root@localhost~]#systemctlenablesmb.service
lns/usr/lib/systemd/system/smb.service/etc/systemd/system/multiuser.target.wants/smb.service
[root@localhost~]#systemctlrestartsmb.service
Jobforsmb.servicefailed.Seesystemctlstatussmb.serviceandjournalctlxnfordetails.
[root@localhost~]#systemctlstatussmb.service
smb.serviceSambaSMBDaemon
Loaded:loaded(/usr/lib/systemd/system/smb.serviceenabled)
[root@localhost~]#systemctlrestartnmb.service
[root@localhost~]#smbclientL//192.1698.42.2+XUuser1
Enteruser1spassword:
Connectionto192.1698.42.2+X
root@localhost~]#smbclientL//192.168.42.2+XUuser1
Enteruser1spassword:
Connectionto192.168.42.2+X
[root@localhost~]#mounttcifs//192.168.42.129+X/project
[root@localhost~]#mounttcifs//192.168.42.2+X/project
[root@localhost~]#dfHT
FilesystemTypeSizeUsedAvailUse%Mountedon
http://whilenetworking.com/2016/06/19/con guring-linux-samba-server/
4/6
15/11/2016
/dev/mapper/centosrootxfs19G4.4G15G24%/
devtmpfsdevtmpfs543M0543M0%/dev
tmpfstmpfs553M492k552M1%/dev/shm
tmpfstmpfs553M7.8M545M2%/run
tmpfstmpfs553M0553M0%/sys/fs/cgroup
/dev/sda1xfs521M130M391M25%/boot
/dev/sr0iso96604.4G4.4G0100%/run/media/ece/CentOS7x86_64
[root@localhost~]#dfHT
FilesystemTypeSizeUsedAvailUse%Mountedon
/dev/mapper/centosrootxfs19G4.4G15G24%/
devtmpfsdevtmpfs543M0543M0%/dev
tmpfstmpfs553M492k552M1%/dev/shm
tmpfstmpfs553M7.8M545M2%/run
tmpfstmpfs553M0553M0%/sys/fs/cgroup
/dev/sda1xfs521M130M391M25%/boot
/dev/sr0iso96604.4G4.4G0100%/run/media/ece/CentOS7x86_64
[root@localhost~]#ls
anacondaks.cfg
[root@localhost~]#cd/media
[root@localhostmedia]#ls
[root@localhostmedia]#umount/media
http://whilenetworking.com/2016/06/19/con guring-linux-samba-server/
5/6
15/11/2016
Pleasenotethefollowingpoint:
[root@localhostmedia]#vim/etc/samba/smb.conf
:setnu
89workgroup=EXAMPLEXMYHOMEtoEXAMPLE(BLOCKLetter)
90serverstring=SambaServerXServerName
92netbiosname=Fileserverremovecomment
95hostsallow=127.172.25.11.netowrkIDwith.
123security=user
Note:
security=serverorsharenopasswordrequired
security=userpasswordrequired
#writedownasfollowingshare
322[project]sharedisplayname
323comment=RWforsambausersandROforrakibsharecomment
324path=/sambasharesharepath
325browseable=yes
326writable=yesuserwriteaccess
327writelist=@sambausersuserprintaccess
328readonly=yesaccessforeveryone
329readlist=rakib
hostsallow=
:x(saveandquit)
Nowyoucanbrowsefromtheclientpart:
=>ChangeWorkGroupfrommycomputer
=>ChangeComputerName
=>Reboot
YoucanalsoBrowsefromWindowsPC:
=>Startmenu=>run=>\\192.168.42.2+X(sambaIP)
LinuxDesktop(Client)toLinuxServerXAccess:
[root@desktopX~]#smbclientL//192.168.42.2+XUuser1
:123
*[N|nopass]*[L|listHOST]*[U]user
Letsseefewscreenshotsofsomesteps:
http://whilenetworking.com/2016/06/19/con guring-linux-samba-server/
6/6