Windows to Linux LAN filesharing (SOLVED)

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Windows to Linux LAN filesharing (SOLVED)

Post by TuftyDave »

OK so you knew this was coming!
Now I got Linux to talk to my WIndows box's I now want to do it the other way.
my linux box is 192.168.0.102
my linux box name on the network is dave-P5Q
The windows network list shows DAVE-P5Q and will not connect to it.
Attempting to connect to HTTP://192.168.0.102/ fails, but I get a real nice message when I click on Diagnose Connection Problems:-

Windows confirmed that "192.168.0.102" is currently online, but is not responding to connection attempts at this time.
This usually means that a firewall is running somewhere between the two computers and is blocking "World Wide Web service (HTTP)".
Windows has confirmed that Windows Firewall on this computer is correctly configured to allow this connection. However, a remote firewall might be blocking your connection.
If you have access to this firewall then configure the firewall to allow connections through TCP port 80. If you do not..... contact administrator.....

So I checked and Linux firewall wasn't blocking anything, so I turned it off anyway, still same problem....

When I open a terminal on the Linux box itself and enter 'nemo smb://192.168.0.102' I get a window for "Windows shares on 192.168.0.102" and the folder I shared is there, but when I click it I'm asked for a password, and no password I have works, the window keeps re-appearing as if I typed the wrong password.

Ideas?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
pgmer6809
Level 4
Level 4
Posts: 228
Joined: Sun Mar 04, 2012 9:06 pm

Re: Windows to Linux LAN filesharing

Post by pgmer6809 »

Firstly if you are just ttrying to use windows shares, then smb (or CIFS) is the right protocol to use.
attempting to use HTTP will try to connect on port 80 and unless you have a web server running (Apache eg) there will be no listener on port 80 and so no connection. So all the windows blather about a firewall is just a red herring at this stage.

Now for Windows shares.
1. Windows does not understand LINUX filesystems (ext2, ext3 etc.) so any share that you want to get to should be on a Fat32 or NTFS partition.
2. Are you running a more recent version of Windows than XP? If so you must get the security settings correct.
3. I assume that since your linux box can connect to windows that you have your workgroup setup correctly. If not do so.
I always change my workgroup from WORKGROUP to something more secure.
4. In Linux sharing with windows is accomplished with an application called SAMBA. To access a windows share all you need is the samba client software. To export a windows share, you need to make sure that the samba server stuff is there also.

Code: Select all

ps -ef | grep smbd

Code: Select all

ps -ef | grep nmbd
should show these two processes running.
5. if they are running then you need to make sure that the permissions are OK.
The configuartion for samba is in /etc/samba/smb.conf
this is a complicated file that gives you full control but you don't want to edit it by hand if you can avoid it.
Go to MENU => CONTROL CENTER => INTERNET and NETWORK and click on the Shared Folders icon.
This should give you a list of shares. To make changes you need to click on the little Lock icon and enter your password.
Then click on the users tab. Make sure that there are enough users enabled. Eg. Nobody, samba guest account, Dave etc.
It helps A LOT if your user name (eg Dave) is the same on your Linux box as on your Windows box.
In fact if it is not, I would create a linux user to correspond to your windows login name, and then enable that user under the shares control panel as above.
Once you have enough users enabled, you want to go to the share and check its permissions by clicking on the Properties button. There is a READ Only option there, that you probably want to turn off.

That should allow you to share with windows. If it does not work, you may have to resort to running the various samba stuff (smbpasswd etc) from the cmd line, or editing the smb.conf file.
But lets try the above first.

One more thing. If you are in a hurry to get a file transfered and the Linux to Windows works, but the WIn to LInux does not, then just go to linux and copy the file in whatever direction you need.
pgmer6809
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Re: Windows to Linux LAN filesharing

Post by TuftyDave »

Hi,

All the samba stuff is fine one copy of nmbd and three copies of smbd running.

You say:-
"Go to MENU => CONTROL CENTER => INTERNET and NETWORK"
Don't have that on my Linux. Could it be under a different name?

I found something that says it is "Personal File Sharing Preferences"
"Share Files over the Network"

But it also says:- "This feature cannot be enabled because the required packages are not installed on your system"
No hint of what those might be however! (subtle hint for Linux coders!)
nerdtron

Re: Windows to Linux LAN filesharing

Post by nerdtron »

TuftyDave wrote:OK so you knew this was coming!
Now I got Linux to talk to my WIndows box's I now want to do it the other way.
my linux box is 192.168.0.102
my linux box name on the network is dave-P5Q
The windows network list shows DAVE-P5Q and will not connect to it.
Attempting to connect to HTTP://192.168.0.102/ fails, but I get a real nice message when I click on Diagnose Connection Problems:-

Windows confirmed that "192.168.0.102" is currently online, but is not responding to connection attempts at this time.
This usually means that a firewall is running somewhere between the two computers and is blocking "World Wide Web service (HTTP)".
Windows has confirmed that Windows Firewall on this computer is correctly configured to allow this connection. However, a remote firewall might be blocking your connection.
If you have access to this firewall then configure the firewall to allow connections through TCP port 80. If you do not..... contact administrator.....

So I checked and Linux firewall wasn't blocking anything, so I turned it off anyway, still same problem....

When I open a terminal on the Linux box itself and enter 'nemo smb://192.168.0.102' I get a window for "Windows shares on 192.168.0.102" and the folder I shared is there, but when I click it I'm asked for a password, and no password I have works, the window keeps re-appearing as if I typed the wrong password.

Ideas?
Try this in the Linux terminal
Enable the firewall:

Code: Select all

sudo ufw enable
Then allow the traffic on port 80:

Code: Select all

sudo ufw allow 80
altair4
Level 20
Level 20
Posts: 11425
Joined: Tue Feb 03, 2009 10:27 am

Re: Windows to Linux LAN filesharing

Post by altair4 »

When I open a terminal on the Linux box itself and enter 'nemo smb://192.168.0.102' I get a window for "Windows shares on 192.168.0.102" and the folder I shared is there, but when I click it I'm asked for a password, and no password I have works, the window keeps re-appearing as if I typed the wrong password.
*** Did you add the user to the samba password database? Unlike Windows, Samba differentiates credentials between Samba use and local login use.

Let's say your user name is dave and you want to connect to your share with that name. You have to add dave to the samba database:

Code: Select all

sudo smbpasswd -a dave
It will first ask you for sudo's password then it will ask you for the password you want to use for samba authentication.

*** As far a connecting to the share from WinXP:

Just select the "Windows Key" + R and enter:

Code: Select all

\\192.168.0.102
Since all your machines have static ip addresses you can map a share from the Linux host by address.

*** If you have further difficulties post the output of these 2 commands so we can see how you are set up:

Code: Select all

testparm -s

Code: Select all

net usershare info --long
There are 2 ways to create a Samba share on Mint - the classic way through smb.conf and the "in the style of a WinXP simple share" through Nemo. The output of the commands above will tell us which one you are using and how it is configured.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Re: Windows to Linux LAN filesharing

Post by TuftyDave »

dave@dave-P5Q ~ $ sudo smbpasswd -a dave-P5Q
New SMB password:
Retype new SMB password:
Failed to add entry for user dave-P5Q.
dave@dave-P5Q ~ $

Doesn't tell me why....
altair4
Level 20
Level 20
Posts: 11425
Joined: Tue Feb 03, 2009 10:27 am

Re: Windows to Linux LAN filesharing

Post by altair4 »

sudo smbpasswd -a dave-P5Q
dave-P5Q is your host name. It's looking for a user name:

Code: Select all

sudo smbpasswd -a dave
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Re: Windows to Linux LAN filesharing

Post by TuftyDave »

OK so managed to add user 'dave' to smb.

We got two threads going now....

The other one "
altair4 wrote:
*** As far a connecting to the share from WinXP:

Just select the "Windows Key" + R and enter:

Code: Select all

\\192.168.0.102
That's the wone that fails and when you click 'diagnose' gives the long message about it being available and active but not responding to connection.... see initial post.
altair4
Level 20
Level 20
Posts: 11425
Joined: Tue Feb 03, 2009 10:27 am

Re: Windows to Linux LAN filesharing

Post by altair4 »

Can you post the output of the testparm and usershare commands so we can rule out any problems with what you are sharing.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Re: Windows to Linux LAN filesharing

Post by TuftyDave »

OK, after updating smb with new user 'dave' I can now do 'nemo smb://192.168.0.102' and log onto the shared folders on my linux box but FROM MY LINUX. Still not able to do it from Windows box on the network.
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Re: Windows to Linux LAN filesharing

Post by TuftyDave »

dave@dave-P5Q ~ $ testparm -s
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
workgroup = MSHOME
server string = %h server (Samba, LinuxMint)
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* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
name resolve order = bcast hosts lmhosts wins
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb

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

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

dave@dave-P5Q ~ $ net usershare info --long
[daveLinux]
path=/home/dave
comment=Daves Linux Mint Files
usershare_acl=Everyone:F,
guest_ok=n
altair4
Level 20
Level 20
Posts: 11425
Joined: Tue Feb 03, 2009 10:27 am

Re: Windows to Linux LAN filesharing

Post by altair4 »

Here we go again. Your other topic had a unique set of symptoms and so does this one.

Just to make sure we are on the same page here bring up the Command Prompt on Windows and enter this command exactly:

Code: Select all

explorer \\192.168.0.102
Does it still give that odd error message?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Re: Windows to Linux LAN filesharing

Post by TuftyDave »

Nope, after a long delay, explorer just opens my 'Documents' folder! (presumably as a default because it couldn't find 192.168.0.102
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Re: Windows to Linux LAN filesharing

Post by TuftyDave »

OK this might seem silly or irrelevant, but does it matter that the windows network sees the Linux machine as 'DAVE-P5Q' and not 'dave-P5Q'?
altair4
Level 20
Level 20
Posts: 11425
Joined: Tue Feb 03, 2009 10:27 am

Re: Windows to Linux LAN filesharing

Post by altair4 »

TuftyDave wrote:Nope, after a long delay, explorer just opens my 'Documents' folder! (presumably as a default because it couldn't find 192.168.0.102
"My Documents" on Windows or "Documents" in your Linux home folder?

If it couldn't find it it will tell you it couldn't find it. Either way I'm going to have to think about this one since I've never seen anything like this before.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Re: Windows to Linux LAN filesharing

Post by TuftyDave »

No, the command 'explorer' is a windows executable that will only run on windows box.
So the command was on a windows vista box and it defaults (if you just type 'explorer') to opening your documents folder.
If you issue the command 'explorer //TOSH/public' It will go to the computer on the network called 'TOSH' and open the shared folder 'public'
But if you issue the command 'explorer //TOSH/pubic' it will go to your usual Documents folder on the box you typed the command on. (unless of course TOSH has a shared folder called 'pubic'!!!)

If it can't find the argument it defaults to just starting explorer as if there were none.
altair4
Level 20
Level 20
Posts: 11425
Joined: Tue Feb 03, 2009 10:27 am

Re: Windows to Linux LAN filesharing

Post by altair4 »

I did not understand your last post.

You said when you issued an "explorer \\1923168.0.102" it opened up "my Documents". I didn't know if that meant the Windows "My Documents" or the Documents folder in your Linux box.

One other thing and again it might just be a typo but:

If you issue the following command ( forward slashes ):

Code: Select all

explorer //192.168.0.102
Explorer interprets that as an internet address and that will end up with a cannot find type of error.

If you enter the command this way ( back slashes ):

Code: Select all

explorer \\192.168.0.102
Explorer interprets that an an internal lan address and it should open the Linux box.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Re: Windows to Linux LAN filesharing

Post by TuftyDave »

Ooops... the forward slashes were just a typo in the text message. i used back slashes in the actual commands.

But it's still true that Explorer when run in this way doesn't return an error if it can't resolve the argument, it simply opens the default 'Documents' folder for the user that issued the command and on the machine the command was issued on.

So when I tried explorer \\192.168.0.102 because it couldn't interpret the IP address it defaults to the documents directory of the user that issued the command (on the machine the command was issued on)

So (and I just tried this!) if you got the slashes the wrong way round, (//TOSH/public) explorer will just open the documents folder rather than go to \\TOSH\public when they are the right way round.
TuftyDave
Level 4
Level 4
Posts: 349
Joined: Tue Apr 09, 2013 6:29 am

Re: Windows to Linux LAN filesharing

Post by TuftyDave »

The interesting thing to me is that when you issue that command "explorer \\192.168.0.102" the delay is quite a significant delay before it opens the default documents folder on the Vista box, and during that delay there is activity on the Linux disc drive which is triggered by the command from the Vista box. I've tried it a few times, so something is happening, it's trying to open it.
altair4
Level 20
Level 20
Posts: 11425
Joined: Tue Feb 03, 2009 10:27 am

Re: Windows to Linux LAN filesharing

Post by altair4 »

So when I tried explorer \\192.168.0.102 because it couldn't interpret the IP address it defaults to the documents directory of the user that issued the command (on the machine the command was issued on)
I've never seen that happen. I've never even read about that happening. Sorry, I'm at an impasse.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Beginner Questions”