[20160921]linux下建立samba伺服器.txt

lfree發表於2016-09-21

[20160921]linux下建立samba伺服器.txt

--工作需要,需要在linux下配置samba服務。好久不做這些事情,做一個安裝筆記:

1.安裝samba軟體包
# rpm -qa | grep samba
samba-client-3.0.33-3.39.el5_8
samba-common-3.0.33-3.39.el5_8
samba-3.0.33-3.39.el5_8

--注意安裝samba-3.0.33-3.39.el5_8需要 perl-Convert-ASN1-0.20-1.1.noarch.rpm包。

2.修改配置檔案:

[backup]
    comment = backup Stuff
    path = /u01/backup
    public = yes
    writable = yes
    printable = no

--我配置比較簡單,先考慮能用先:

chmod 777 /u01/backup

--看了配置檔案/etc/samba/smb.conf:
# ----------------------- Standalone Server Options ------------------------
#
# Security 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 = user
    passdb backend = tdbsam

--其他方式share(deprecated) or server(deprecated)好像廢除了。不過我還是先測試看看。修改如下:

    security = share
;   passdb backend = tdbsam

3.啟動服務:
# service smb  restart
Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]

4.在我本機測試:
--//在我的電腦上輸入:
\\192.168.100.78\backup

5.下面測試使用密碼的方式:
--修改配置檔案/etc/samba/smb.conf:
    security = user
    passdb backend = tdbsam

# cat /etc/passwd | mksmbpasswd.sh >| /etc/samba/smbpasswd

# smbpasswd root
New SMB password:
Retype new SMB password:
Failed to find entry for user root.
Failed to modify password entry for user root

--這裡報錯,修改如下,再次執行smbpasswd root 。ok!
    passdb backend = smbpasswd
--不對這個是預設模式。
--看了一些相關文件 http://blog.csdn.net/tg5156/article/details/8865775

# service smb  restart
Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]

--這樣使用口令,能看到共享磁碟。

6.下面測試使用密碼的方式:
--修改配置檔案/etc/samba/smb.conf:
    security = user
    passdb backend = tdbsam

[backup]
    comment = backup Stuff
    path = /u01/backup
    valid users=root oracle
    public = yes
    writable = yes
    printable = no
#   write list = +staff

--參考了連結http://blog.csdn.net/tg5156/article/details/8865775。

# pdbedit -x oracle
# pdbedit -a oracle
new password:
retype new password:
Unix username:        oracle
NT username:
Account Flags:        [U          ]
User SID:             S-1-5-21-375937087-413791906-1356901787-1007
Primary Group SID:    S-1-5-21-375937087-413791906-1356901787-513
Full Name:
Home Directory:       \\gxqyydg4\oracle
HomeDir Drive:
Logon Script:
Profile Path:         \\gxqyydg4\oracle\profile
Domain:               GXQYYDG4
Account desc:
Workstations:
Munged dial:
Logon time:           0
Logoff time:          never
Kickoff time:         never
Password last set:    Wed, 21 Sep 2016 08:54:45 CST
Password can change:  Wed, 21 Sep 2016 08:54:45 CST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

--再次測試ok。

7.順便測試windows下oracle資料使用rman的情況,太穩定了,經常報錯。

channel ORA_DISK_3: starting piece 1 at 2016-09-20 17:34:54
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 09/20/2016 17:35:29
ORA-19502: write error on file "\\192.168.100.78\BACKUP\FULL_0SRG9VT9_1_1.BAK", block number 19072 (block size=8192)
ORA-27070: async read/write failed
OSD-04016: Error queuing an asynchronous I/O request.
O/S-Error: (OS 64) 指定的網路名不再可用。

--放棄!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2125248/,如需轉載,請註明出處,否則將追究法律責任。

相關文章