LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   [SAMBA] Cannot find my shared folder (https://www.linuxquestions.org/questions/linux-newbie-8/%5Bsamba%5D-cannot-find-my-shared-folder-4175438228/)

dragonix 11-22-2012 12:42 AM

[SAMBA] Cannot find my shared folder
 
Hi all

The whole idea is to share a folder (duh..) within a network and if that is working, then I want to extend it over the internet, with the needed security ofcourse.

I installed Samba on my Ubuntu 12.04, but I cannot find my shared folder..
Maybe nice to know, that I'm doing this on the network from my work (so not my home network, didn't had the time to check it yesterday)

Anyway, the steps I took, were

Code:

$ sudo su
$ apt-get install samba samba-common
$ nano /etc/samba/smb.conf

In the config file, I added/edited the following
Code:

[Global]
security = user
workgroup = wokrgroup
server string = Samba server %v
netbios name = ubuntu
map to guest = bad user
dns proxy = no

[share]
path = /samba/share
browsable = yes
writable = yes
guest ok = yes
read only = no

I want to get access to this file with my Windows 7 laptop (the samba server, which is also a laptop and the W7 laptop are 2 separate physical devices)
So, when I use RUN and enter \\ubuntu, it cannot find the server..

What did I do wrong?

Dragonix

Lexus45 11-22-2012 02:51 AM

The problem seems to be not in Samba but in name resolving.
Are you sure, your Win PC knows the IP address of the PC with the hostname 'ubuntu' ?
Add the appropriate entry to your DNS server (if you use one) or at least an entry to Windows' hosts file.

The other way is just to use the IP address instead of hostname, while connecting to your Samba PC, e.g. on Windows - \\192.168.0.4

--
You may also chech your Samba config file with 'testparm' command (on Ubuntu). And also look at your own shares with 'smbclient -L localhost' command.

dragonix 11-22-2012 03:00 AM

Um, not sure if he knows that IP address..
When I do ifconfig on my ubuntu laptop, i have 4 different ip addresses.
Which one do I need to use and in what way?

- lo (loopback, so no need for that one)
- eth0 (no cable, so no luck here)
- tunsnx (I believe the IP address for my VPN connection or something?)
- wlan0 (since it's connected over wireless, this is my best bet)

So, assume that the IP address of wlan0 -> 192.168.0.22
How can I gain access with this IP address on my WIN laptop?
I did it with run (\\192.168.0.22\) but appears to be not successfull
and in firefox (http://192.169.0.22/) but also no luck..

Thanks for your effort btw!

Lexus45 11-22-2012 03:06 AM

About interfaces:
you must know exactly in what network is your Samba PC located, and the Win PC must be in the same subnet. Compare Windows' IP addresses with the Ubuntu's IP addresses. They must be equal (not guaranteed if to be honest). Just try connecting to all of them, except loopback, whe connecting from Windows.

About Firefox:
you can not connect Samba server via HTTP protocol , like you can not drive your car like a plane.
Samba uses the very other TCP protocol than HTTP. It's very different things.

So, first of all you have to be sure that your PCs see each other. When it will be so, you can configure any services you want.

dragonix 11-22-2012 03:16 AM

Quote:

Originally Posted by Lexus45 (Post 4834582)
About interfaces:
you must know exactly in what network is your Samba PC located, and the Win PC must be in the same subnet. Compare Windows' IP addresses with the Ubuntu's IP addresses. They must be equal (not guaranteed if to be honest). Just try connecting to all of them, except loopback, whe connecting from Windows.

About Firefox:
you can not connect Samba server via HTTP protocol , like you can not drive your car like a plane.
Samba uses the very other TCP protocol than HTTP. It's very different things.

So, first of all you have to be sure that your PCs see each other. When it will be so, you can configure any services you want.

Good point about the devices should be in the same network.
Subnetmask is 255.255.240.0, so the range goes from 192.168.0.1 to 192.168.15.254, and then 192.168.16.1 to 192.168.30.254, and so on ... (broadcast address and network address left out)
If I'm not mistaking? (it has been a while :D)

If so, then they are in the same subnet..

Would it make sense that I copy the /etc/samba/smb.conf file here? So you can take a look how everything is configured?

Adol 11-22-2012 05:36 AM

Just a quick thought.

Did you restart Samba(its easier to just restart both computers)?

Also, make sure that the workgroups are the same and that a firewall is not blocking your samba server. If you have an autoconfigured firewall it will usually block it unless you specify it not to.

If its on the same workgroup and not blocked by a firewall, after a restart, windows should detect it.

dragonix 11-22-2012 05:39 AM

I have restarted the samba server
Code:

sudo restart smbd
sudo restart nmbd

But I didn't restart the WIN pc.

Like I said in my first post, at this moment I'm on the network of my company.. So I assume the FW of this network is blocking it.
Just wanted to make sure if that was the case.

Can I verify this, by perhaps pinging to a IP address or whatever?

Thanks for the tips btw

deep27ak 11-22-2012 09:23 AM

If your windows and ubuntu machine are on the same network then you should be able to access the shares

So basically you are not on VPN and you have not connected LAN cable and you are on Wireless which is on same network as on Windows 7. If all these are correct then give a check to firewall and selinux on ubuntu.

Once you restart your smb and nmb services check the log file for any clue. Disable your firewall or create new rules for firewall

Here I have written the iptables rule for RedHat
IPtables rules for Samba server

I am not so good with selinux rules so you can hit a google search for how to allow samba to pass through selinux or you can disable it and do a restart to make the changes affect

dragonix 11-23-2012 12:40 AM

I will have a look ;)
Thanks!

Still haven't got the time to check it at home.. I believe it will work there (hopefully..)
I will keep this posted!


All times are GMT -5. The time now is 08:14 AM.