linux suse 共享目录_window 文件共享给 SUSE Linux

Access Windows Shares from Linux

Q. How do I Access Windows share from Linux command prompt? I would

like to be able to access shared folders on Windows machines from my

Linux system.

A. There are two ways. Use command line tool called smbclient or you

can mount windows shares the mount command. Another option is use GUI

tools. Please refer previous articles about access windows share from

Linux:

( a ) Mount Windows share using mount command

This is simple way to share data between windows and linux system.

You would like to access MS-Windows share called

//windowsserver/sharename by mounting to /mnt/win directory under Linux

system. Type the following command (replace username, windows server

name, share name and password with actual values):

# mkdir -p /mnt/share

# mount -t cifs -o username=winntuser,password=mypassword //windowsserver/sharename /mnt/share

# cd /mnt/win

# ls -l

For the share //windowsserver/sharename to be automatically mounted at

every system start (after reboot), insert an option in the file

/etc/fstab:

# vi /etc/fstab

Append following line (written in a single line)

//windowserver/share /mnt/share cifs

auto,gid=users,fmask=0664,dmask=0775,iocharset=iso8859-15, credentials=/etc/sambapasswords 0 0

Next create the password file /etc/sambapasswords:

#vi /etc/sambapasswords

Now add following content:

username = winntuser

password = mypassword

Save and close the file. Make sure only root can access your file:

# chown 0.0 /etc/sambapasswords

# chmod 600 /etc/sambapasswords

-t smbfs

: File system type to be mount (outdated, use cifs)

-t cifs

: File system type to be mount

-o

: are options passed to mount command, in this

example I had passed two options. First argument is password (vivek) and

second argument is password to connect remote windows box

//windowserver/share

: Windows 2000/NT share name

/mnt/win

Linux mount point (to access share after mounting)

分享到:

18e900b8666ce6f233d25ec02f95ee59.png

72dd548719f0ace4d5f9bca64e1d7715.png

2012-05-10 14:52

浏览 992

分类:互联网

评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
学习操作系统时我们都了解到文件系统是操作系统的重要组成部分之一。文件系统有很多种类型,比windows的fat、fat32;Linux的ext、ext2或ext3;FreeBSD的ufs等等。在使用Linux的过程,也常常Linux操作系统使用虚拟文件系统VFS,通过VFS可以直接存取其它已被内核支持的各种文件系统,用起来就像是在普通的 Linux的ext系列文件系统一样。早期的Linux内置支持的文件系统不多,自 kernel 2.0.x 起并支持到 VFAT ,以后逐 渐增加,到目前可以说 决大多数的文件系统都有了支持。只是有一些如NTFS需要重新编译内核才能支持。   Linux在启动过程中,会按照/etc/fstab中的设置,把各个分区上的文件系统加挂到对应到加载点上去。Linux至少需要两个分区才能启动:一个是根分区/,另一个是交换分区,如果在启动时根分区加载失败,Linux就不能完成启动。如果交换分区加载失败,Linux就不能仍能启动,在内存不够的情况下速度就会受很大的影响。根分区的文件系统类型通常是ext、ext2或ext3,但也可以是其它的一些文件系统。   除了加载了Linux所必需的文件系统外,Linux的用户还经常需要使用其它的各种文件系统,特别是在一台机器上同时安装多个操作系统的时候。比如笔者的机器上同时安装了LinuxWindows2000,其中Windows的C盘采用了NTFS文件系统、D盘采用了FAT32文件系统。而当我在Linux上工作的时候,常常需要访问Windows的C盘和D盘的内容,甚至是网络上的共享目录Linux下加挂一个文件系统使用的是mount命令,用man mount命令可以得到命令参数的详细解释。下面就来介绍一下在几种情况下以命令行方式加挂文件系统的具体方法:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值