Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux server-install samba

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Install samba

1. Check whether samba is installed. If not, you can use yum to install it. At least 3 softwares need to be installed: samba, samba-client, samba-common

[root@localhost pub] # rpm-qa | grep samba

Samba-winbind-clients-3.6.9-164.el6.i686

Samba-client-3.6.9-164.el6.i686

Samba-common-3.6.9-164.el6.i686

Samba4-libs-4.0.0-58.el6.rc4.i686

Samba-winbind-3.6.9-164.el6.i686

[root@localhost pub] # yum install-y samba samba-client samba-common / / if not, you can install it with this command

2. Create a shared directory

[root@localhost /] # mkdir / wj / / create a directory

[root@localhost /] # chmod 777 / wj / / set permissions

3. Modify the configuration file "/ etc/samba/smb.cnf"

[root@localhost /] # gedit / etc/samba/smb.conf

#-Standalone Server Options-

# Scurity can be set to user, share (deprecated) or server (deprecated)

# Backend to store user information in. New installations should

# use either tdbsam or ldapsam. Smbpasswd is available for backwards

# compatibility. Tdbsam requires no further configuration

Security = share / / the default is user, which is changed to share, so that it can be accessed without entering a password

Passdb backend = tdbsam

[wj] / / create a shared directory configuration

Comment=wj / / first name

Path=/wj / / path

Whether read only=no / / is read-only, here is no, so users can create folders

Guest ok=yes / / whether to allow guest users to log in

Browseable=yes / / can I browse the directory?

4. Modify the firewall and open the ports 137,138,139,445 of tcp.

[root@localhost wj] # gedit / etc/sysconfig/iptables

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 137-j ACCEPT

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 138j ACCEPT

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 139-j ACCEPT

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 445-j ACCEPT

[root@localhost wj] # service iptables restart

Iptables: set chain to policy ACCEPT: filter nat [OK]

Iptables: clear firewall rules: [OK]

Iptables: uninstalling module: [OK]

Iptables: apply firewall rules: [OK]

Iptables: load additional modules: nf_conntrack_ftp [OK]

5. Start the smb service

[root@localhost wj] # service smb start

Start the SMB service: [OK]

6. Test. Enter the command "testparm" in the terminal and you can see the information of the shared directory.

[root@localhost wj] # testparm

Load smb config files from / etc/samba/smb.conf

Rlimit_max increasing rlimit_max (1024) to minimum Windows limit (16384)

Processing section "[homes]"

Processing section "[printers]"

Processing section "[wj]"

WARNING: The security=share option is deprecated

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

Security = SHARE

Log file = / var/log/samba/log.%m

Max log size = 50

Idmap config *: backend = tdb

Cups options = raw

[homes]

Comment = Home Directories

Read only = No

Browseable = No

[printers]

Comment = All Printers

Path = / var/spool/samba

Printable = Yes

Print ok = Yes

Browseable = No

[wj]

Comment = wj / / first name

Path = / wj / / path

Read only = No / / whether read-only

Guest ok = Yes / / whether guest access is allowed

7. From the windows test, press the shortcut key "window+r" and enter the command "smb:\\ 192.168.0.113" in the pop-up window to see the shared directory of the machine.

A Linux learning platform has been made, and a prototype has come out at present, which you can refer to and use.

Link: https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ password: n7bk

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report