accessing smb folders in terminal

Rashkae ubuntu at tigershaunt.com
Thu Jan 8 14:19:45 UTC 2009


Kevin wrote:
> I am able to use GUI (Nautilus and Firefox) to access smb://windows_host/
> folder on my Ubuntu 8.10. Can someone please advise how to access the 
> folder in a terminal?  I want to write a script to move files between 
> windows_host and Ubuntu.
> 

You have 2, possibly 3 choices.

1. You can mount the remote filesystem.  You need super user privilages
to do this.  Install the smbfs package.

sudo mkdir /mnt/network

sudo mount -t cifs //remote/sharename /mnt/network -o
username=remoteUsername uid=localUsername

2. You can use smbclient, which works much the same was as ftp for
SMB/CIFS network shares.  man smbclient.


3.  I believe your version of Ubuntu has the new gnome virutal FS that
already mounts your network drives for you somewhere in your /home
directory structure.  However, this is probably not predictable enough
to write scripts against.




More information about the ubuntu-users mailing list