samba 開通 LINUX開啟SAMBA服務

2021-10-13 12:25:43 字數 3841 閱讀 9289

samba,用於網路檔案共享,類似於nfs,

samba多用於win和linux之間

linux之間多用nfs

c/s架構

smb協議

samba主要是兩個服務,核心啟動服務smb,監聽139tcp埠,nmb服務類似dsn功能,如果不啟,只能以ip來訪問,監聽137 138udp埠

使用yum -y install samba

然後防火牆

systemctl stop firewalld.service

然後selinux

[root@localhost ~]# sestatus

selinux status: enabled

selinuxfs mount: /sys/fs/selinux

selinux root directory: /etc/selinux

loaded policy name: targeted

current mode: enforcing

mode from config file: enforcing

policy mls status: enabled

policy deny_unknown status: allowed

max kernel policy version: 31

[root@localhost ~]# setenforce 0

[root@localhost ~]# sestatus

selinux status: enabled

selinuxfs mount: /sys/fs/selinux

selinux root directory: /etc/selinux

loaded policy name: targeted

current mode: permissive

mode from config file: enforcing

policy mls status: enabled

policy deny_unknown status: allowed

max kernel policy version: 31

[root@localhost ~]#

啟動下smb

[root@localhost ~]# service smb status

redirecting to /bin/systemctl status smb.service

● smb.service - samba smb daemon

loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled)

active: inactive (dead)

docs: man:smbd(8)

man:samba(7)

man:smb.conf(5)

[root@localhost ~]# systemctl start smb

[root@localhost ~]# service smb status

redirecting to /bin/systemctl status smb.service

● smb.service - samba smb daemon

loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled)

active: active (running) since mon 2019-04-01 15:34:00 cst; 5s ago

docs: man:smbd(8)

man:samba(7)

man:smb.conf(5)

main pid: 3137 (smbd)

status: "smbd: ready to serve connections..."

tasks: 4

cgroup: /system.slice/smb.service

├─3137 /usr/sbin/smbd --foreground --no-process-group

├─3140 /usr/sbin/smbd --foreground --no-process-group

├─3141 /usr/sbin/smbd --foreground --no-process-group

└─3142 /usr/sbin/smbd --foreground --no-process-group

apr 01 15:34:00 localhost.localdomain systemd[1]: starting samba smb daemon...

apr 01 15:34:00 localhost.localdomain smbd[3137]: [2019/04/01 15:34:00.812166, 0] ../lib/util/become_daemon.c:138(daemon_ready)

apr 01 15:34:00 localhost.localdomain smbd[3137]: daemon_ready: status=daemon 'smbd' finished starting up and ready to serve connections

apr 01 15:34:00 localhost.localdomain systemd[1]: started samba smb daemon.

[root@localhost ~]#

配置檔案/etc/samba/smb.conf,就預設配置吧

然後新增使用者

[root@localhost samba]# pdbedit -a oracle

new password:

retype new password:

unix username: oracle

nt username:

account flags: [u ]

user sid: s-1-5-21-3894974451-2409427747-3149240937-1000

primary group sid: s-1-5-21-3894974451-2409427747-3149240937-513

full name:

home directory: \\localhost\oracle

homedir drive:

logon script:

profile path: \\localhost\oracle\profile

domain: localhost

account desc:

workstations:

munged dial:

logon time: 0

logoff time: wed, 06 feb 2036 23:06:39 cst

kickoff time: wed, 06 feb 2036 23:06:39 cst

password last set: mon, 01 apr 2019 15:49:50 cst

password can change: mon, 01 apr 2019 15:49:50 cst

password must change: never

last bad password : 0

bad password count : 0

logon hours : ffffffffffffffffffffffffffffffffffffffffff

[root@localhost samba]# pdbedit -l

oracle:54321:

[root@localhost samba]#

win中入網賬號密碼就可以了

samba 開通 Samba安裝與配置

四 samba例項 需求 配置 software目錄的共享,允許user1 user2兩個使用者完全訪問 建立目錄 mkdir software 新增使用者 useradd user1 passwd user1 useradd user2 passwd user2 新增samba密碼 pdbedit...

samba 開通 samba 設定 網路共享

1.gedit etc samba smb.conf 將smb.conf 檔案中的 security user 改為security share 在 smb.conf 檔案的最後部分新增如下內容 share comment tmp share path share writeable yes bro...

linus開啟snmp Linux開通snmp

以centos為例,在linux下開通snmp 1.如果有yum環境,yum安裝snmp元件 yum install net snmp tar xzvf net snmp 5.3.4.tar.gz cd net snmp 5.2 configure with perl modules prefix ...