ubuntu访问windows共享目录

Ubuntu下配置samba实现文件夹共享

. 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  - // 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的连接.

猜你喜欢

转载自dcbjavaeye.iteye.com/blog/2085395