Discussion:
smb : Couldn't connect to server
Jean-Baptiste Gardette
2015-02-23 12:30:12 UTC
Permalink
Hello

I use curl 7.40 on windows 7

I want to upload a file to a server Samba (slackware), I use this command :
curl -T essai.txt -u "user:passwd" smb://192.168.x.x/home/share

who return :
curl : (7) Couldn't connect to server

with verbose option :
Trying 192.168.x.x...
Connected to 192.168.x.x (192.168.x.x) port 445 (#0)
Closing connection 0
curl : (7) Couldn't connect to server

What can be the reasons ?


Thank
Jean-Baptiste

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
http://www.avast.com


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiq
Dan Fandrich
2015-02-23 13:56:10 UTC
Permalink
Post by Jean-Baptiste Gardette
I use curl 7.40 on windows 7
curl -T essai.txt -u "user:passwd" smb://192.168.x.x/home/share
curl : (7) Couldn't connect to server
Trying 192.168.x.x...
Connected to 192.168.x.x (192.168.x.x) port 445 (#0)
Closing connection 0
curl : (7) Couldn't connect to server
What can be the reasons ?
Error 7 means that there was no way to establish a connection to the server.
The likely reason is that the server isn't running an SMB server, or there is a
firewall in the way blocking the connection.
Post by Jean-Baptiste Gardette
Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://c
Jean-Baptiste Gardette
2015-02-26 15:13:02 UTC
Permalink
Post by Dan Fandrich
Post by Jean-Baptiste Gardette
I use curl 7.40 on windows 7
curl -T essai.txt -u "user:passwd" smb://192.168.x.x/home/share
curl : (7) Couldn't connect to server
Trying 192.168.x.x...
Connected to 192.168.x.x (192.168.x.x) port 445 (#0)
Closing connection 0
curl : (7) Couldn't connect to server
What can be the reasons ?
Error 7 means that there was no way to establish a connection to the server.
The likely reason is that the server isn't running an SMB server, or there is a
firewall in the way blocking the connection.
Post by Jean-Baptiste Gardette
Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
I verified and the daemon smbd is running on the server.

About the firewall, my computer and my server are in the same subnet so
I don't think the firewall intervenes, am I mistaken ?

I can upload and download files with explorer of Windows without any
problems.

I add that I can not to dowloand file with :
curl -u "user:passwd" -o file.txt smb://192.168.x.x/home/share/
(same answer : (7) Couldn't connect to server)

But I can with : curl -o file.txt http://192.168.x.x/home/ShareDevpt/

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
http://www.avast.com

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquett
Gisle Vanem
2015-02-26 16:24:11 UTC
Permalink
I can upload and download files with explorer of Windows without any problems.
curl -u "user:passwd" -o file.txt smb://192.168.x.x/home/share/
(same answer : (7) Couldn't connect to server)
You could try adding "user:passwd" to your %HOME%/_netrc file
instead (to rule out any shell issue munging your cmd-line).
If you have no %HOME, on Windows this should be:
%USERPROFILE%\Application Data\_netrc

with lines like:
machine 192.168.x.x login user password passwd
But I can with : curl -o file.txt http://192.168.x.x/home/ShareDevpt/
Strange. If it was an access-rights issue, you would have got
curl: (67) Login denied

7 is CURLE_COULDNT_CONNECT, which can have many reasons (including
a firewall or antivirus program).
--
--gv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquet
Loading...