CentOS7samba及windows映射網(wǎng)絡(luò)驅(qū)動(dòng)器,-創(chuàng)新互聯(lián)

第一步:安裝samba服務(wù)
》yum install samba
第二步:啟動(dòng)samba服務(wù)
》systemctl start smb
查看samba的狀態(tài)
》systemctl status smb
看到Active就說明在運(yùn)行中了
第三步:關(guān)閉防火墻
》systemctl stop firewalld.service //停止服務(wù)
》systemctl disable firewalld.service //關(guān)閉開機(jī)啟動(dòng)
同時(shí)還有這一步
設(shè)置SELINUX=disabled(需要重啟電腦)

創(chuàng)新互聯(lián)技術(shù)團(tuán)隊(duì)十多年來致力于為客戶提供成都做網(wǎng)站、網(wǎng)站設(shè)計(jì)、成都品牌網(wǎng)站建設(shè)、營銷型網(wǎng)站建設(shè)、搜索引擎SEO優(yōu)化等服務(wù)。經(jīng)過多年發(fā)展,公司擁有經(jīng)驗(yàn)豐富的技術(shù)團(tuán)隊(duì),先后服務(wù)、推廣了超過千家網(wǎng)站,包括各類中小企業(yè)、企事單位、高校等機(jī)構(gòu)單位。

vi /etc/selinux/config文件中設(shè)置SELINUX=disabled ,然后重啟服務(wù)器。

第四步:需要添加一個(gè)用戶來訪問文件
》useradd lcd //添加用戶
》passwd lcd? //修改密碼
創(chuàng)建samba用戶
》smbpasswd -a lcd
第五步:修改samba的配置文件
》vi /etc/samba/smb.conf //進(jìn)入配置文件
5.1將global中進(jìn)行一下全局配置更改:
? ? workgroup = WORKGROUP//定義工作組,也就是windows中的工作組概念
security = user //安全認(rèn)證方式采用user方式
ntlm auth = yes //否則windows7訪問用戶會認(rèn)證失敗
5.2在conf中添加新的用戶配置(讓4的配置生效)
[lcd]
? ? ? ? path = /cloud/lcd? ?//共享目錄
? ? ? ? browsable =yes? ?
? ? ? ? writable = yes? ? ?//目錄可讀可寫
? ? ? ? read only = no
修改后的smb.conf如下:
[global]
? ? ? ? workgroup = WORKGROUP
? ? ? ? security = user
? ? ? ? passdb backend = tdbsam
? ? ? ? printing = cups
? ? ? ? printcap name = cups
? ? ? ? load printers = yes
? ? ? ? cups options = raw
? ? ? ? ntlm auth = yes
[homes]
? ? ? ? comment = Home Directories
? ? ? ? valid users = %S, %D%w%S
? ? ? ? browseable = No
? ? ? ? read only = No
? ? ? ? inherit acls = Yes
[printers]
? ? ? ? comment = All Printers
? ? ? ? path = /var/tmp
? ? ? ? printable = Yes
? ? ? ? create mask = 0600
? ? ? ? browseable = No
[print$]
? ? ? ? comment = Printer Drivers
? ? ? ? path = /var/lib/samba/drivers
? ? ? ? write list = @printadmin root
? ? ? ? force group = @printadmin
? ? ? ? create mask = 0664
? ? ? ? directory mask = 0775
[lcd]
? ? ? ? path = /cloud/lcd
? ? ? ? browsable =yes
? ? ? ? writable = yes
? ? ? ? read only = no
第六步:設(shè)置想要共享目錄的文件權(quán)限
給共享目錄添加寫權(quán)限,這樣可以從windows向linux中寫入文件。比如我這里設(shè)置\home為共享目錄,那在終端輸入以下命令即可
chmod -R 777 /cloud/lcd (可寫 w=4 可讀 r=2? 可執(zhí)行 x=1 )
第七步:重啟samba服務(wù)
》systemctl restart smb

測試及使用:
win7:\10.xx.xx.xx\lcd? ?提示輸入賬號密碼。
————————————————
版權(quán)聲明:本文為CSDN博主「sparrowwf」的原創(chuàng)文章,遵循 CC 4.0 BY-SA 版權(quán)協(xié)議,轉(zhuǎn)載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/sparrowwf/article/details/81064318


先掛載好CentOS光盤文件

[root@localhost /]# yum install samba
[root@localhost /]useradd -s /sbin/nologin jitai1
[root@localhost /]smbpasswd -a jitai1

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

[global]

workgroup = SAMBA

    workgroup = WORKGROUP 
    security = user
    ntlm auth = yes
    passdb backend = tdbsam

    printing = cups
    printcap name = cups
    load printers = yes
    cups options = raw

[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775

[jitai1]
comment = jitai1
path = /tmp/jitai1
browsable = yes
writable = yes
read only = no

win 10 即可網(wǎng)絡(luò)驅(qū)動(dòng)器映射jitai1目錄。
win10的記事本,輸入如下,保存為startupZ.bat文件
net use Z: \10.24.11.93\jitai1 jitai1 /user:jitai1 /persistent:yes

1.首先在電腦的左下角,點(diǎn)擊開始菜單,在菜單中選擇“運(yùn)行”選項(xiàng)。
2.然后在運(yùn)行窗口中輸入“shell:startup”,點(diǎn)擊確定。
3.此時(shí)打開的文件夾窗口就是“windows10啟動(dòng)”界面。
4.將startupZ.bat 放入該目錄,開機(jī)自動(dòng)映射網(wǎng)絡(luò)驅(qū)動(dòng)器。

A服務(wù)器10.24.11.93:
[root@cent7x64 ~]# ssh-keygen -t rsa
[root@cent7x64 ~]# cat ~/.ssh/id_rsa.pub
[root@cent7x64 ~]# scp id_rsa.pub root@10.24.11.91:/root/.ssh/authorized_keys

B服務(wù)器10.24.11.91:
[root@cent7x64 ~]# ssh-keygen -t rsa
[root@cent7x64 ~]# cat ~/.ssh/id_rsa.pub
[root@cent7x64 ~]# scp id_rsa.pub root@10.24.11.93:/root/.ssh/authorized_keys

從10.24.11.93拷貝文件到10.24.11.91:
[root@cent7x64 ~]cat bakjitai1.sh
#!/bin/bash
scp -r /tmp/jitai1/ root@10.24.11.91:/tmp/jitai1date +%Y%m%ddate +%H:%M:%S

[root@localhost tmp]# cat rmrfjitai1.sh
!#/bin/bash
rm -rf /tmp/jitai1/.

[root@localhost tmp]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

For details see man 4 crontabs

Example of job definition:

.---------------- minute (0 - 59)

| .------------- hour (0 - 23)

| | .---------- day of month (1 - 31)

| | | .------- month (1 - 12) OR jan,feb,mar,apr ...

| | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat

| | | | |

* user-name command to be executed

/2 * root /tmp/bakjitai1.sh

/3 * root /tmp/rmrfjitai1.sh

定時(shí)拷貝就不用密碼驗(yàn)證了。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

當(dāng)前標(biāo)題:CentOS7samba及windows映射網(wǎng)絡(luò)驅(qū)動(dòng)器,-創(chuàng)新互聯(lián)
轉(zhuǎn)載注明:http://bm7419.com/article20/dpddjo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供響應(yīng)式網(wǎng)站、網(wǎng)站導(dǎo)航軟件開發(fā)、云服務(wù)器、網(wǎng)站策劃網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)