file-sharing kubuntu, windows 7 & mac

Asked by hagen on 2012-01-09

Hi there,

I'm running Kubuntu on a Dell Inspiron n5110 laptop. We have a WiFi network for Internet access at home, my wife uses a Macbook Pro and the kids have Windows 7 laptops.

For quite some time it has been my dream to share files between these computers using the WiFi network. Every once in a while I get the urge to work on the problem and I start searching the net for suggestions - and there are many: most of them confusing and conflicting. A common thread seems to be SAMBA though - everybody describes it as the best thing sliced bread, and according to most setting up is as easy as making a sandwich!

I've been using one version of linux or another for the last 20 years or so - therefore, I don't consider myself a complete novice, but SAMBA is like black magic to me! It seemed to work very well when we had a wired network, but since the introduction of WiFi I just can't get it to work at all!

Would somebody please point me to a COMPREHENSIVE (perhaps even a "for Dummies") tutorial on how to get file-sharing to work between Kubuntu, Mac & Windows 7 machines?

Regards
Hagen

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu samba Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

If you install samba you can use nautilus to share folders using the right click menu on the folder you want to share. Alternatively you can do it at command line with:

sudo apt-get install samba; sudo nano /etc/samba/smb.conf

and add these lines:

[Downloads]
path = /home/andy/Downloads
comment = Andy's stuff
browsable = yes
read only = no
writable = yes
valid users = andy
invalid users = root bin daemon nobody

Save the new file, and restart the samba service with:

sudo service smbd stop; sudo service smbd start

Obviously change the path and the valid user. You will need to run:

sudo smbpasswd -a $USER

and set a samba password (you can store this in your OS when you first connect) and get full access. Your choice, the command line way has the advantage that you can connect to the server via SSH and re-edit the file to add an additional share, restart the service and the share will be available.

hagen (hnieberding) said : #2

Thanks for the advice!

At first glance it does look like to stuff I've tried so many times
without success, but I will go through you instructions line by line o
make sure. I let you know the results.

Regards
Hagen Nieberding
Ph.D. (Ind. Eng.), M.Sc. (Mech. Eng.), Pr.Eng.
Requirements and Evaluation Directorate
Emirates Advanced Research & Technology Holdings (EARTH)
a subsidiary of Emirates Advances Investments
Tel: +971 (0)55 718-2547 (UAE)
Tel: +971 (0)2 586-3172 (UAE)
Tel: +27 (0)82 823-1516 (South Africa)
Fax: +27 (0)86 651-3594 (South Africa)

On 09/01/12 17:15, actionparsnip wrote:
> Your question #184160 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/184160
>
> Status: Open => Answered
>
> actionparsnip proposed the following answer:
> If you install samba you can use nautilus to share folders using the
> right click menu on the folder you want to share. Alternatively you can
> do it at command line with:
>
>
> sudo apt-get install samba; sudo nano /etc/samba/smb.conf
>
>
> and add these lines:
>
>
> [Downloads]
> path = /home/andy/Downloads
> comment = Andy's stuff
> browsable = yes
> read only = no
> writable = yes
> valid users = andy
> invalid users = root bin daemon nobody
>
>
> Save the new file, and restart the samba service with:
>
>
> sudo service smbd stop; sudo service smbd start
>
>
> Obviously change the path and the valid user. You will need to run:
>
>
> sudo smbpasswd -a $USER
>
>
> and set a samba password (you can store this in your OS when you first connect) and get full access. Your choice, the command line way has the advantage that you can connect to the server via SSH and re-edit the file to add an additional share, restart the service and the share will be available.
>

hagen (hnieberding) said : #3

Here are the results from the actions proposed by Actionparsnip to share
files between three computers running three different operating systems:
Apple Mac, Windows 7 and Kubuntu 11.04.

Samba was installed, but I did amended the smb.conf files as indicated.
Below the current status of the file:
[global]
         workgroup = MIDDLE_EARTH
         server string = %h server (Samba, Ubuntu)
         encrypt passwords = No
         map to guest = Bad User
         obey pam restrictions = Yes
         pam password change = Yes
         passwd program = /usr/bin/passwd %u
         passwd chat = *Enter\snew\s*\spassword:* %n\n
*Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
         username map = /etc/samba/smbusers
         unix password sync = Yes
         syslog = 0
         log file = /var/log/samba/log.%m
         max log size = 1000
         dns proxy = No
         usershare allow guests = Yes
         panic action = /usr/share/samba/panic-action %d

[printers]
         comment = All Printers
         path = /var/spool/samba
         create mask = 0700
         printable = Yes
         browseable = No

[print$]
         comment = Printer Drivers
         path = /var/lib/samba/printers

[Public]
         comment = Public
         path = /home/Public
         invalid users = root, bin, daemon, nobody
         valid users = cora, hagen
         read only = No

I executed the command "sudo smbpasswd -a $USER" without really knowing
what it does, then stopped and re-started the smbd.

At the time I had two Windows machines and the Mac laptop connected to
the WiFi network.

Opened Dolphin, my preferred file manager in Kubuntu, choose network -
nothing. Had a look at the Windows and Mac machines, to see whether the
linux machine was visible - nothing.

OK, so maybe Nautilus has some magic voodoo to make this samba stuff
work. Installed Nautilus, clicked on Network - nothing. After some time
5 - 10 minutes) the one Windows machine appears on the Nautilus window -
and I could log on using the normal username and password for that machine.

Where the Mac and the other windows laptop? Checked the settings on the
2nd windows machine - they are identical. After another while the 2nd
machine pops into view on Nautilus, but I can't log in - none of the
username password combinations work.

OK, I tired and frustrated because nothing is working properly, so I
switch everything off and go to bed. This morning I boot the same
machine up, start Nautilus - nothing.

I tried to connect to the linux machine from the mac by connecting to
smb://192.168... (using the IP address for the linux machine), but none
of username password combinations work.

As far as I can see there are still a samba issues:
1. Why are the other machines on the network not visible in Nautilus or
Dolphin?
2. Why is the linux machine not visible / accessible from any of the
other machines?

There also seems to be a log-in issue: How are the usernames and
passwords of the users who have accounts on the linux machine related to
the samba users?

I realise this must be tedious for the experts, but I'm really
struggling with this and am grateful for any assistance I can get.

Regards
Hagen

Hagen Nieberding
Ph.D. (Ind. Eng.), M.Sc. (Mech. Eng.), Pr.Eng.
Requirements and Evaluation Directorate
Emirates Advanced Research & Technology Holdings (EARTH)
a subsidiary of Emirates Advances Investments
Tel: +971 (0)55 718-2547 (UAE)
Tel: +971 (0)2 586-3172 (UAE)
Tel: +27 (0)82 823-1516 (South Africa)
Fax: +27 (0)86 651-3594 (South Africa)

-------- Original Message --------
Subject: Re: [Question #184160]: file-sharing kubuntu, windows 7 & mac
Date: Tue, 10 Jan 2012 15:38:10 +0400
From: Hagen Nieberding <email address hidden>
Reply-To: <email address hidden>
To: <email address hidden>

Thanks for the advice!

At first glance it does look like to stuff I've tried so many times
without success, but I will go through you instructions line by line o
make sure. I let you know the results.

Regards
Hagen Nieberding
Ph.D. (Ind. Eng.), M.Sc. (Mech. Eng.), Pr.Eng.
Requirements and Evaluation Directorate
Emirates Advanced Research & Technology Holdings (EARTH)
a subsidiary of Emirates Advances Investments
Tel: +971 (0)55 718-2547 (UAE)
Tel: +971 (0)2 586-3172 (UAE)
Tel: +27 (0)82 823-1516 (South Africa)
Fax: +27 (0)86 651-3594 (South Africa)

On 09/01/12 17:15, actionparsnip wrote:
> Your question #184160 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/184160
>
> Status: Open => Answered
>
> actionparsnip proposed the following answer:
> If you install samba you can use nautilus to share folders using the
> right click menu on the folder you want to share. Alternatively you can
> do it at command line with:
>
>
> sudo apt-get install samba; sudo nano /etc/samba/smb.conf
>
>
> and add these lines:
>
>
> [Downloads]
> path = /home/andy/Downloads
> comment = Andy's stuff
> browsable = yes
> read only = no
> writable = yes
> valid users = andy
> invalid users = root bin daemon nobody
>
>
> Save the new file, and restart the samba service with:
>
>
> sudo service smbd stop; sudo service smbd start
>
>
> Obviously change the path and the valid user. You will need to run:
>
>
> sudo smbpasswd -a $USER
>
>
> and set a samba password (you can store this in your OS when you first connect) and get full access. Your choice, the command line way has the advantage that you can connect to the server via SSH and re-edit the file to add an additional share, restart the service and the share will be available.
>

The accounts you connect to saba are not the system accounts, they are separate and are managed with smbpasswd, you added a samba password for the same name as the user that ran it, when challenged for a password, use the password you set. Obviously it's easier to use the same password as the user logs in with

Can you help with this problem?

Provide an answer of your own, or ask hagen for more information if necessary.

To post a message you must log in.