In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to install the samba server". In the daily operation, I believe many people have doubts about how to install the samba server. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to install the samba server". Next, please follow the editor to study!
First, install the software
[root@station10 ~] # yum install-y samba samba-common samba-client system-config-samba
View installed software
[root@station10 ~] # rpm-aq | grep samba
Samba-3.0.25b-0.el5.4
System-config-samba-1.2.39-1.el5
Samba-client-3.0.25b-0.el5.4
Samba-common-3.0.25b-0.el5.4
[root@station10 ~] #
[@ more@]
Second, configure samba in the following three ways
1meme systemfills configfsamba
2Maple Samba Whisswat (http://localhost:901)
3, edit the smb.conf file
Third, configure samba through the third method
1. Create a shared folder
[root@station10 /] # mkdir / backup
[root@station10 /] # chmod 777-R / backup
2, add at the end of / etc/samba/smb.conf:
[backup]
Comment = backup
Path = / backup
Writeable = yes
Public = yes
Printable = no
3, add samba users
[root@station10 /] # smbpasswd-a root
New SMB password:
Retype new SMB password:
[root@station10 /] # smbpasswd-a back
New SMB password:
Retype new SMB password:
[root@station10 /] #
4, test syntax
[root@station10 /] # testparm / etc/samba/smb.conf
Load smb config files from / etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[backup]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
Workgroup = MYGROUP
Server string = Samba Server Version% v
Passdb backend = tdbsam
Cups options = raw
[homes]
Comment = Home Directories
Read only = No
Browseable = No
[printers]
Comment = All Printers
Path = / var/spool/samba
Printable = Yes
Browseable = No
[backup]
Comment = backup
Path = / backup
Read only = No
Guest ok = Yes
[root@station10 /] # testparm / etc/samba/smb.conf station10.example.com 192.168.0.10
Load smb config files from / etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[backup]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Allow connection from station10.example.com (192.168.0.10) to homes
Allow connection from station10.example.com (192.168.0.10) to printers
Allow connection from station10.example.com (192.168.0.10) to backup
[root@station10 /] #
5. Start samba
[root@station10 /] # / etc/init.d/smb start
Starting SMB services: [OK]
Starting NMB services: [OK]
[root@station10 /] #
6, test on another machine
[root@station12] # smbclient-L station10-U 'back%redhat'
Domain= [STATION10] OS= [Unix] Server= [Samba 3.0.25b-0.el5.4]
Sharename Type Comment
-
Backup Disk backup
IPC$ IPC IPC Service (Samba Server Version 3.0.25b-0.el5.4)
Back Disk Home Directories
Domain= [STATION10] OS= [Unix] Server= [Samba 3.0.25b-0.el5.4]
Server Comment
--
Workgroup Master
--
MYGROUP
[root@station12 ~] #
7, an error occurred while creating the folder
[root@station12 ~] # smbclient-U 'back%redhat' / / station10/backup
Domain= [STATION10] OS= [Unix] Server= [Samba 3.0.25b-0.el5.4]
Smb: > ls
. D 0 Fri Oct 17 18:36:04 2008
.. D 0 Fri Oct 17 18:36:05 2008
63483 blocks of size 65536. 17042 blocks available
Smb: > mkdir test
NT_STATUS_ACCESS_DENIED making remote directory test
Smb: >
8. Check the corresponding policies of selinux.
# SELINUX NOTES:
#
# If you want to use the useradd/groupadd family of binaries please run:
# setsebool-P samba_domain_controller on
#
# If you want to share home directories via samba please run:
# setsebool-P samba_enable_home_dirs on
#
# If you create a new directory you want to share you should mark it as
# "samba-share_t" so that selinux will let you write into it.
# Make sure not to do that on system directories as they may already have
# been marked with othe SELinux labels.
#
# Use ls-ldZ / path to see which context a directory has
#
# Set labels only on directories you created!
# To set a label use the following: chcon-t samba_share_t / path
#
# If you need to share a system created directory you can use one of the
# following (read-only/read-write):
# setsebool-P samba_export_all_ro on
# or
# setsebool-P samba_export_all_rw on
#
# If you want to run scripts (preexec/root prexec/print command/...) Please
# put them into the / var/lib/samba/scripts directory so that smbd will be
# allowed to run them.
# Make sure you COPY them and not MOVE them so that the right SELinux context
# is applied, to check all is ok use restorecon-R-v / var/lib/samba/scripts
#
#-
9. Change the policy of selinux
[root@station10 /] # chcon-t samba_share_t / backup
[root@station10 /] # / etc/init.d/smb restart
Shutting down SMB services: [OK]
Shutting down NMB services: [OK]
Starting SMB services: [OK]
Starting NMB services: [OK]
[root@station10 /] #
10. Continue to set up a folder to test ok:
[root@station12 ~] # smbclient-U 'back%redhat' / / station10/backup
Domain= [STATION10] OS= [Unix] Server= [Samba 3.0.25b-0.el5.4]
Smb: > mkdir test
Smb: > ls
. D 0 Fri Oct 17 18:44:36 2008
.. D 0 Fri Oct 17 18:36:05 2008
Test D 0 Fri Oct 17 18:44:36 2008
63483 blocks of size 65536. 17042 blocks available
Smb: >
11, set up simple sharing
Change the profile security to share
Security = share
Restart the samba service
[root@station10 ~] # / etc/init.d/smb restart
Test:
[root@station10 ~] # smbclient / / station10/backup
Password:
Domain= [MYGROUP] OS= [Unix] Server= [Samba 3.0.25b-0.el5.4]
Server not using user level security and no password supplied.
Smb: >
Fourth, samba Client Tools: nmblookup
List specific machine
Nmblookup-U WINS_server-R name
List all machines
Nblookup *
[root@station12 ~] # nmblookup *
Querying * on 192.168.0.255
192.168.0.10 *
192.168.0.12 *
[root@station12 ~] #
Five, samba Clients Tools:mounts
The SMB and CIFS file systems are supported by the Linux Kernel
Use mount to mount a Samba-shared resource:
Mount-t cifs service mountpoing-o option1,option2
Example:
[root@station12] # mount-t cifs / / station10/backup / mnt-o username=back
Password:
[root@station12 ~] # mount
/ dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
Proc on / proc type proc (rw)
Sysfs on / sys type sysfs (rw)
Devpts on / dev/pts type devpts (rw,gid=5,mode=620)
/ dev/mapper/VolGroup00-LogVol01 on / home type ext3 (rw)
/ dev/sda1 on / boot type ext3 (rw)
Tmpfs on / dev/shm type tmpfs (rw)
None on / proc/sys/fs/binfmt_misc type binfmt_misc (rw)
Sunrpc on / var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/ / station10/backup on / mnt type cifs (rw,mand)
[root@station12 ~] #
Or add root users to samba users
[root@station12] # smbpasswd-a root
New SMB password:
Retype new SMB password:
Added user root.
[root@station12 ~] #
[root@station12] # mount-t cifs / / station10/backup / mnt
Password:
[root@station12 ~] # mount
/ dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
Proc on / proc type proc (rw)
Sysfs on / sys type sysfs (rw)
Devpts on / dev/pts type devpts (rw,gid=5,mode=620)
/ dev/mapper/VolGroup00-LogVol01 on / home type ext3 (rw)
/ dev/sda1 on / boot type ext3 (rw)
Tmpfs on / dev/shm type tmpfs (rw)
None on / proc/sys/fs/binfmt_misc type binfmt_misc (rw)
Sunrpc on / var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/ / station10/backup on / mnt type cifs (rw,mand)
[root@station12 ~] #
At this point, the study on "how to install the samba server" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.