现在的位置: 首页 > 综合 > 正文

《华清远见学习手记》之 配置Ubuntu8.10 的samba服务

2013年10月19日 ⁄ 综合 ⁄ 共 1209字 ⁄ 字号 评论关闭

 

配置Ubuntu8.10
samba
服务

 

1.    


下载并安装 samba
服务的相关程序包

sudo apt-get install    samba    smbfs

2.    


添加一个用户,专用于samba
客户登陆

useradd        
zlq

passwd         
zlq

mkdir            /home/zlq

chown  
zlq    /home/zlq

3.    


创建一个目录用于共享

mkdir  
/home/boat_man/share

      chmod  777  
/home/boat_man/share

4.    


编辑samba
的配置文件

sudo  vim  /etc/samba/smb.conf

security = user
(

要密码登陆)
security = share
(

无需密码登陆)

smb.conf
文件的末尾添加:

[share]

path = /home/boat_man/share

public = yes

writable = yes

 

5.    


用第2
步创建的用户添加samba
用户

sudo
touch   /etc/samba/smbpasswd

sudo
smbpasswd   -a   zlq

6.
重启
samba
服务

    Sudo
/etc/init.d/samba restart

   

若出现
boat_man is not int the sudoers file!

提示

   

需要将
boat_man
填加到
sudoers  

:

   
su –

    chmod u+w  
/etc/sudoers

   
vim     /etc/sudoers

   

root ALL=(ALL) ALL
下面加入
:

    boat_man
ALL=(ALL) ALL

chmod  u-w
 /etc/sudoers

6.    


查看samba
服务状态

/etc/init.d/samba
status

* nmbd
is running.

* smbd
is running.

7.
检测samba
共享信息

smbclient
–L  /localhost/share

我的出现这样的提示:session setup failed:    NT_STATUS_LOGON_FAILURE

原来是少了登陆用户的选项。

smbclient
–L  /localhost/share –U  zlq

输入密码,OK
,共享信息出来了!
我试了一下:

smbclient
–L  /localhost –U  zlq

smbclient
–L  localhost –U  zlq

smbclient
–L  //localhost –U  zlq

很有趣,发现localhost
前面不论又有多少个 /
/
都可以,不信你试试看!

8.    


window xp
上测试samba

     在地址栏输入
//192.168.2.223


(我的虚拟机的IP), 要求输入用户和密码,zlq ,*****
成功的进入ubuntu
下的共享目录

/home/boat_man/share

 

抱歉!评论已关闭.