设为首页 收藏本站
查看: 602|回复: 0

[经验分享] Unix Study之案例--配置Solaris 10下的SAMBA

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-1-27 08:47:38 | 显示全部楼层 |阅读模式
  Samba服务可以快速实现Unix和Windows环境之间文件共享,在Solaris 10下配置Samba非常简单,以下为具体的配置步骤。  1、配置samba的主配置文件smb.conf
    默认smb.conf文件不存在,但在/etc/sfw下有个smb.conf.example文件,可以生成smb.conf
1
2
3
4
5
6
7
8
9
[iyunv@node1:/export/home/oracle]# cd /etc/sfw

[iyunv@node1:/etc/sfw]# ls

a2ps-site.cfg     foomatic          openssl           ser               zebra

a2ps.cfg          mysql             private           smb.conf-example

[iyunv@node1:/etc/sfw]# cp smb.conf-example smb.conf



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
[iyunv@node1:/etc/sfw]# cat smb.conf
"smb.conf" [Read only] 271 lines, 9662 characters
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# For a step to step guide on installing, configuring and using samba,
# read the Samba-HOWTO-Collection. This may be obtained from:
#  http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# Many working examples of smb.conf files can be found in the
# Samba-Guide which is generated daily and can be downloaded from:
#  http://www.samba.org/samba/docs/Samba-Guide.pdf
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
   workgroup = MYGROUP
# server string is the equivalent of the NT Description field
   server string = Samba Server
# Security mode. Defines in which mode Samba will operate. Possible
# values are share, user, server, domain and ads. Most people will want
# user level security. See the Samba-HOWTO-Collection for details.
   security = user
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
;   hosts allow = 192.168.1. 192.168.2. 127.
# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
   load printers = yes
# you may wish to override the location of the printcap file
;   printcap name = /etc/printcap
# on SystemV system setting printcap name to lpstat should allow
# you to automatically obtain a printer list from the SystemV spool
# system
;   printcap name = lpstat
# It should not be necessary to specify the print system type unless
# it is non-standard. Currently supported print systems include:
# bsd, cups, sysv, plp, lprng, aix, hpux, qnx
;   printing = cups
# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
;  guest account = pcguest
/share
# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
;   logon script = %m.bat
# run a specific logon batch file per username
;   logon script = %U.bat
# Where to store roving profiles (only for Win95 and WinNT)
#        %L substitutes for this servers netbios name, %U is username
#        You must uncomment the [Profiles] share below
;   logon path = \\%L\Profiles\%U
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
;   wins support = yes
# WINS Server - Tells the NMBD components of Samba to be a WINS Client
#       Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z
# WINS Proxy - Tells Samba to answer name resolution queries on
/
# machine to add or delete corresponding unix accounts
;  add user script = /usr/sbin/useradd %u
;  add group script = /usr/sbin/groupadd %g
;  add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
;  delete user script = /usr/sbin/userdel %u
;  delete user from group script = /usr/sbin/deluser %u %g
;  delete group script = /usr/sbin/groupdel %g

#============================ Share Definitions ==============================
[homes]
   comment = Home Directories
   browseable = no
   writable = yes
# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
;   comment = Network Logon Service
;   path = /usr/sfw/lib/netlogon
;   guest ok = yes
;   writable = no
;   share modes = no
......
---以上为默认的smb.conf的配置信息,默认samba共享系统用户的home目录,如果只是共享系统用户home目录,可以使用默认配



2、启动samba相关process
     Samba的启动进程为smbd和nmbd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[iyunv@node1:/etc/sfw]# find / -name samba

/var/spool/samba

/var/samba

/usr/sfw/lib/webmin/blue-theme/samba

/usr/sfw/lib/webmin/caldera/samba

/usr/sfw/lib/webmin/mscstyle3/samba

/usr/sfw/lib/webmin/samba

/etc/webmin/samba

[iyunv@node1:/etc/sfw]# find / -name smbd

/usr/sfw/sbin/smbd


[iyunv@node1:/etc/sfw]# find / -name nmbd

/usr/sfw/sbin/nmbd


[iyunv@node1:/etc/sfw]# /usr/sfw/sbin/smbd start

[iyunv@node1:/etc/sfw]# ps -ef |grep smb     

    root   774     1   0 10:15:21 ?           0:00 /usr/sfw/sbin/smbd start

    root   775   774   0 10:15:22 ?


[iyunv@node1:/etc/sfw]# /usr/sfw/sbin/nmbd start         
[iyunv@node1:/etc/sfw]# ps -ef |grep nmb

    root   777     1   0 10:15:29 ?           0:00 /usr/sfw/sbin/nmbd start

[iyunv@node1:/etc/sfw]# netstat -an|grep 45

      *.445                *.*                0      0 49152      0 LISTEN



3、配置访问samba共享的用户(首先必须是系统用户)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[iyunv@node1:/etc/sfw]# ls /usr/sfw/bin|grep smb

findsmb

smbcacls

smbclient

smbcontrol

smbcquotas

smbget

smbpasswd

smbspool

smbstatus

smbtar

smbtree

[iyunv@node1:/etc/sfw]# /usr/sfw/bin/smbpasswd -a oracle

New SMB password:

Retype new SMB password:

Added user oracle.



4、客户端共享 访问
QQ截图20150127084457.jpg


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-41549-1-1.html 上篇帖子: 单用户模式只读现象 下篇帖子: Xmanager连接Centos6.3的远程桌面
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表