且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2022-09-05 19:24:24

[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) 指定的网络名不再可用。

--放弃!