[HELP] Ubuntu + Win7 file share!

allenpan

Senior member
Nov 16, 2005
508
0
71
[HELP] Ubuntu + Win7 file share!

--------------------------------------------------------------------------------

[HELP] Ubuntu + Win7 file share!
i am having hard to get my Ubuntu 10.04 to access my win7 folder/drive over network,

my OS X Snow leopard has no problem accessing those foler, but with the new ubuntu, it keep asking me for autherization and denying it

i already add the username to sercurity properties in windows with full control, but still no luck, i dont use the home share crap..

i used able to use smb://192.168.2.101/D$ in mac, but i dont know why i cant do it with ubuntu
__________________
 

Paperlantern

Platinum Member
Apr 26, 2003
2,239
6
81
Yeah Linux is a bit different. There are a couple ways to do this, you can use a single command to connect one time, such as

Code:
mount -t cifs -o username=<username>,password=<password> //<server>/<share> /mnt/windoz

Make sure there actually IS a directory on the ubuntu machine that references the last bit of that line

You can permanently mount it as well, so that the share is always displayed in whatever location youd like it to be in each time you boot the machine, this is ideal since you wont have to type the command everytime, and your share will be available to you whenever you need it.

To mount permanently...

First, edit your /etc/hosts file and give the Windows machine a name, note: this is an example and the IP address will obviously need to be YOUR actual Windows machine IP:

Code:
192.168.1.2   machinename

Second, make sure samba and smbfs packages are installed... use your method of choice for that (package manager works fine)

Third... Create a directory where you want the share to be on your local system, again this is an example, you can create the share anywhere and call it anything. You also dont have to use terminal for this, you can use the file manager.

Code:
$ sudo mkdir /mnt/share

Fourth... Edit /etc/fstab and add a line that pertains to your share.

Code:
//machinename/share  /mnt/share  cifs exec,credentials=/etc/cifspw 0 0

Fifth... Create the password file referenced above /etc/cifspw with the username and password for your Windows account.

Code:
username=Username
password=Password

Sixth... It's a good idea to secure the file, though you dont HAVE to, it will work without this part, but leaves it as unsecured:

Code:
$ sudo chmod 600 /etc/cifspw

Seventh... You are ready to rock and roll...

Code:
$ sudo mount -a

The last will then put the mount into place, but you also will not have to do it manually ever again, it will always be there each time you start the machine, ready to go.
 
Last edited:

joetekubi

Member
Nov 6, 2009
176
0
71
PaperLantern's post is accurate, as far as I can tell. Coupla of additional thougths and tips.
Not sure what window manager you are running, but in Nautilus (default gnome) or Konqueror (Kubuntu), you should be able to access MS shares by pasting in the command you listed:
smb://192.168.2.101/D$

I lilke to use "smb4k" to easily view and access shares. Just do:
"sudo apt-get install smb4k" and then set your workgroup name.

Since all these use the Samba client programs to access MS shares, you may be able to find some diagnostic messages or error messages in /var/log/smb* log files.

HTH,
-joe