Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1580860
  • 博文数量: 92
  • 博客积分: 2002
  • 博客等级: 大尉
  • 技术积分: 4717
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-01 17:09
文章分类

全部博文(92)

文章存档

2013年(1)

2012年(6)

2011年(85)

分类: LINUX

2011-02-18 08:58:21

把samba的使用方法整理一下,省得每次有问题都得网上搜

1.服务管理


  1. service smb status
  2. service smb start
  3. service smb stop
  4. service smb restart
2.samba与selinux

有时候明明设置了samba home dir的写权限,但是无法生效。往往是由于selinux引起的。

你可以关闭selinux,selinux是拥有一个灵活而强制性的访问控制,它缺省情况下不允许samba用户目录的功能,这里先关闭它。
关闭的方法为:修改/etc/selinux/config中的SELINUX=““为disabled,然后重启Linux。

在/etc/samba/smb.conf中也有注释说明如何使 samba与selinux共存
  1. # SELINUX NOTES:
  2. #
  3. # If you want to use the useradd/groupadd family of binaries please run:
  4. setsebool -P samba_domain_controller on
  5. #
  6. # If you want to share home directories via samba please run:
  7. setsebool -P samba_enable_home_dirs on

3.使用root用户登录samba


通常情况下,不能采用root用户登录,但是只要重新给root用户设置了samba密码就可以了,如下:
  1. [root@gpon ~]$ smbpasswd -a root
  2. New SMB password:
  3. Retype new SMB password:
  4. Added user root.
之后,重新设置一下root用户登录的路径之类,就可以在其他系统(XP、linux)登录该samba服务器了。

4.XP下更改samba账户来进行登录

Windows XP Login to Linux/Unix Samba Networking  
Last   updated:   8/22/2004    

Q.I just clean-installed Windows XP Pro and used the same workgroup,PC name, use account name,and password.
I previously ran Windows 200 Pro and it had no problem connecting to my private account on a Red Hat Linux server running Samba for Windows networking.
I can see accounts on the server with guest access,but my private, password-protected account is no longer visible in My Network Places. 
How do I configure Windows XP to access it?  
   
A. Click Start, Control Panel, User Accounts, click the specific user, and in Related Tasks at the top of the resulting window, choose Manage my network passwords.
In the Stored User Names and Passwords window that results, click the Add button.
In the Server: text box, Enter the Linux/Unix server name. My server is simply called Linux.
In the User name:text box, Enter server name/user name; e.g., linux/lbyard. and enter the password. Reboot. With the Windows Explorer, look in My Network Places,
Entire Network, Microsoft Windows Network, the workgroup name,for the linux server name, and click the + beside it.You should then see the account.
When you click on it the first time it may ask you for the password. After the first time, it should not prompt for the password.
For convenience you can then click and hold the Account name in the Windows Explorer and drag it to the My Network Places icon.  
That will create a short cut to the account and put it where it is readily visible. 


阅读(2637) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~