---
title: "ubuntu访问windows共享目录"
author: "dcbjavaeye"
date: "2014-06-26T16:07:30Z"
tags: []
categories: ["操作系统"]
slug: "ubuntu-windows"
draft: false
lastmod: "2014-06-26T16:07:30Z"
id: 2085395
url: "https://dcbjavaeye.iteye.com/blog/2085395"
---

与

## [Ubuntu下配置samba实现文件夹共享](http://www.cnblogs.com/phinecos/archive/2009/06/06/1497717.html)

 

一. samba的安装:

sudo apt-get insall samba  
sudo apt-get install smbfs

二. 创建共享目录:

mkdir /home/phinecos/share  
sodu chmod 777 /home/phinecos/share

三. 创建Samba配置文件:

1\. 保存现有的配置文件

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

2\. 修改现配置文件

sudo gedit /etc/samba/smb.conf

在smb.conf最后添加

\[share]  
      path = /home/phinecos/share  
      available = yes  
      browseable = yes  
      public = yes  
      writable = yes

四. 创建samba帐户

  sudo touch /etc/samba/smbpasswd  
  sudo smbpasswd -a phinecos

然后会要求你输入samba帐户的密码

 ［如果没有第四步，当你登录时会提示 session setup failed: NT\_STATUS\_LOGON\_FAILURE］

 五. 重启samba服务器

sudo /etc/init.d/samba restart

六. 测试

smbclient -L //localhost/share

七，使用

可以到windows下输入ip使用了，在文件夹处输入 "\\\\" + "Ubuntu机器的ip或主机名" + "\\\\" + "share"

八 挂载 ubuntu访问windows共享文件夹mount -t smbfs -o username=administrator,password=aa,rw //172.18.1.1/d$ /mnt  
这是老版本的用法,

现在的用法是:  
mount -t cifs -o username=administrator,password=aa,rw //172.18.1.1/d$ /mnt  
   
cifs= common internat file system  
系统中已经没有mount.smbfs这个命令了,只有mount.cifs  
其他两个mount.smb和mount.smbfs是指向mount.cifs的连接.