pnethood - samba share mounter

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

pnethood - samba share mounter

#1 Post by HairyWill »

Now at version 0.65
<edit date="14/02/20010">
I'm updating this post for historical accuracy. The latest version of pnethood I released is 0.65. I believe that there is a later version circulating with a small patch to the mount command to support UTF-8.

A number of puplets and Barry's current development releases are now using Patriots lameSMBxplorer instead. It is unlikely that pnethood will be developed further so if neither pnethood or lameSMBxplorer work for you it is probably better to report a bug against lameSMBxplorer.
</edit>

This GUI is for mounting windows samba shares on your puppy pc. It is intended to be simpler to use than linneighborhood especially for use on small home networks.
The screenshot below shows pnethood 0.5 with an error message visible. For those interested in visual friparary the screenshot was taken in pup214R using the debian red gtk theme with jwm set to match.

Image

Project Status

Depends On:

* smbclient
* smbmount
* rox (filer needed to show open a window once share is connected)
* rxvt (needed to view the log)
* (all of the above are included in the basic iso for recent puppys)
* nbtscan (included in the pet)

Done:

* separate show/connect/disconnect buttons
* entry in the network menu
* separate tabs for each machine
* separate authentication details for each server
* rescans server with password if annoymous scan fails
* if password scan fails, checks mount to see if any shares are already mounted from that server
* inbuilt limit of 10 servers scanned, once this limit is exceeded you get a list of all servers and are asked to choose one.
* server and share names with spaces, dots and hyphens should work (only partially tested, may cause name collisions ie: my-server and my_server)
* servers may be specified by IP address
* scan includes every network interface, except ppp ones. I can't see why you would want to scan a ppp interface, it was taking ages and taking down my pptp vpn connection
* tabs are always shown for servers with shares that are currently mounted
* status, error handling and reporting (can't really be improved much without further user feedback)

To Do

* Allow user with more than 10 machines to select a new one without rescanning the entire network
* Handle servers with lots of shares. This will probably mean changing the interface implementation to use gtkdialog tree instead of buttons. This is a shame because I like the buttons.
* replace nbtscan with a scan that works with netbios over tcp/ip, this will probably just be a backup in case nbtscan produces nothing
* cifs support
* find a better way of dealing with passwords
* allow user to control how long nbtscan waits for servers to identify themselves
* move the mountpoint into /mnt somewhere

Known Bugs

Could run out of screen space for large numbers of shares.

nbtscan

This program relies on nbtscan for super faster scanning of your network to find machines to check for shares. Thanks to Alla Bezroutchko. Nbtscan relies on the NetBIOS protocol. If your windows computer is running Windows 2000 or above though it is possible that NetBIOS has been disabled. The default is for it to be enabled so it is likely that nbtscan will work.

If you are interested in building nbtscan yourself it is available here: http://www.inetcat.net/software/nbtscan.html
Attachments
pnethood-0.65.pet
(38.28 KiB) Downloaded 1859 times
pnethood-0.5.pet
(35.96 KiB) Downloaded 2767 times
Last edited by HairyWill on Sun 14 Feb 2010, 03:05, edited 21 times in total.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

So it doesn't need the Samba utilities at all?

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#3 Post by HairyWill »

BarryK wrote:So it doesn't need the Samba utilities at all?
I'm not a magician :wink:
It uses smbmount and smbclient plus any dependencies they have and nbtscan which is only a few k. It works in the experimental dingo release without installing anything else. The nbtscan timeout is currently set for 1 second, I think this could do with upping a bit.

it doesn't need
smblookup
which gfilemanager was complaining about

When complete my intention is that all the gui contains will be username and password boxes, mount/unmount buttons and a refresh button.

Because it automatically lists all shares it may need extending in some way to cope with larger networks and +20 shares, to avoid excessive scan times and running out of screen space.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#4 Post by BarryK »

Ah, I've just realised something. Dingo has 'nmblookup', 'smbclient', 'smbmnt', 'smbmount', 'smbspool', 'smbumount'.

There is no 'smblookup' in the Samba package, I just checked the original full package.

Will, could you test something -- try creating a symlink smblookup to nmblookup, see if that makes Gfilemanager happy.

Ah, no, there may be a difference. See this package:
http://gnu.rtin.bz/directory/all/gsmbscanner.html

This site has a PHP script for smblookup:
https://trac.anl.gov/scavenger/browser/ ... lookup.php
...it just calls nmblookup, with certain parameters.

...so, we should be able to create a 'smblookup' also, to satisfy Gfilemanager, maybe get it from that gsmbscanner package.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#5 Post by HairyWill »

now at version 0.2
As this is still very much in the testing phase it would be great to get any feedback even if it is just "it works" or "it doesn't work"

Barry
I have replied on your latest blog including patched src for gfilemanager which doesn't mount shares locally.

Bumped to version 0.21 to fix small but deadly bug in subnet calculation

Done
separate show/connect/disconnect buttons
label to show status
entry in the network menu

To Do
better status reporting
error handling and reporting
automated rescanning with password if anonymous scan fails
replace nbtscan with a scan that works with netbios over tcp/ip

Bugs
fails to scan if all the shares from my server are mounted
if mount fails buttons and label still indicate success (workaround click disconnect then try connect again)

version 0.21 received 21 downloads
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

pnethood 0.3

#6 Post by HairyWill »

Now at version 0.3
Some testing feedback would be really helpful especially to trap any complaints from servers that are not being handled properly. I've run out of error states on mine but there must be loads more.

Done:

* some error handling and reporting
* automatically caculates x.x.0.0/16 subnet to scan from your IP address
* status of each operation reported at bottom of screen
* separate tabs for each machine
* separate authentication details for each server
* rescans server with password if anonymous scan fails
* if password scan fails, checks mount to see if any shares are already mounted from that server

To Do

* Implement an inbuilt limit on the number of servers scanned, once this limit is exceeded it should just present a list of all servers and ask the user to choose one.
* Handle servers with lots of shares. This will probably mean changing the interface implementation to use gtkdialog tree instead of buttons. This is a shame because I like the buttons.
* better status reporting
* error handling and reporting
* replace nbtscan with a scan that works with netbios over tcp/ip

Known Bugs

Could run out of screen space for large numbers of shares or servers
Error not handled if you don't have an IP address
nbtscan described twice in the help
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#7 Post by disciple »

With a very simple Win98 network setup with no passwords or anything that works fine with linNeighborhood:

Code: Select all

~# pnethood "192.168.2.1"
cat: /root/pnethood/.passwords/192.168.2.1username: No such file or directory
cat: /root/pnethood/.passwords/192.168.2.1password: No such file or directory
Error connecting to 192.168.2.1 (Connection refused)
cat: /root/pnethood/.passwords/192.168.2.1username: No such file or directory
cat: /root/pnethood/.passwords/192.168.2.1password: No such file or directory
and it says "no shares",

or running with no inputs:

Code: Select all

~# pnethood
EXIT="abort"
/usr/local/pnethood/pnethood: line 152: 31124 Terminated              gxmessage "Pnethood scanning network, please wait"
and it says "Failed to bind: address already in use"

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#8 Post by HairyWill »

thanks for the reply
It currently expects a machine name not an ip address as a parameter
ie
pnethood "myserver"
good point though, I will implement handling of IP addresses

I haven't included for access to password-less shares yet so I expect the smbmount command string will be wrong for you. I need to crank down the security on my server to test this.

the output of

Code: Select all

 ifconfig | grep inet| grep -v "127.0.0.1" | sed 's/ *inet addr://g;s/ .*//g'| cut -d . -f 1-2
would be helpful

I realised last night that the subnet calculation just assumes a single active network interface excluding loopback. I suspect that line 23 of /usr/local/pnethood/pnethood needs a "head -n 1" inserted before sed./usr/local/pnethood/pnethood

add to todo
password-less shares
specifying server by ip
calculate subnet using the right interface - The only time this goes wrong for me is if I have a VPN tunnel open, the right one is always output first I presume because of alphabetic ordering. I wish that hostname -i worked properly, but /etc/hosts is not formatted/maintained correctly. I suppose I do need to use route to calculate the subnet.

thanks for the feedback
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#9 Post by disciple »

The output is 192.168 (My IP should be 192.168.2.33, the router is .2.1 and the "server" I want to connect to is .2.36)
I only have one active interface, but that is a good point to take into account :)

Your thing about line 23 doesn't make sense - maybe you have a later version that you've uploaded? Or is there a typo there?

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#10 Post by HairyWill »

Disciple I presume that as you are talking about win98 it is using raw netbios and not netbios over tcp/ip which is on my todo list.

What version of puppy are you running?
Does the server have a name, maybe
pnethood name
will work for you?

What output do you get for
nbtscan 192.168.2.0/24
if that works I would be interested to confirm that
nbtscan 192.168.0.0/16
does as well

regarding line 23 discussed above, yes, I pasted something in by mistake there shouldn't be "./usr/local/pnethood/pnethood" after "sed" but I think we've ruled that line out as the cause anyway.

pnethood sends debugging output to /tmp/pnethood-log
and the gui xml to /tmp/pnethood-gui
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#11 Post by Béèm »

I tried to use pnethood.
My configuration:
- Desktop (XP)
WiFi device at 192.168.1.2
ETH1394 device at 10.0.10
- Laptop (3.01)
WiFi device at 192.168.1.3
ETH1394 at 10.0.11

I started pnethood to do discovery of the network.
The window says scanning network please wait.
That windows stays forever until I push ok, but nothing is discovered.

Both PC sea each other with pin as well with the WiFi devices as with the ETH1394 devices.

Three pnethood processes are generated.
They stay there forever unless I kill them.

Then I tried LinNeighborhood on Puppy.
The Desktop is found, scanned and the shares found, which I can mount.

Where does it go wrong with pnethood?
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#12 Post by HairyWill »

Beem,
Thanks for the feedback.
The subnet calculation doesn't work properly if you have more than one working network interface, I will patch this in the next couple of days.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#13 Post by Béèm »

Ok, HaiyWill, I'll watch this thread.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

davec51
Posts: 530
Joined: Thu 13 Apr 2006, 22:31
Location: Virginia

Samba Share Mounter

#14 Post by davec51 »

I have always used Lin Neighborhood with no trouble for my wired connection with an XP in the next room. I tried pnethood, but it wouldn't connect, no matter what I tried. I might add that I'm technically hopeless.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#15 Post by disciple »

It works great if I use pnethood name :)
It does say

Code: Select all

timeout connecting to 192.168.2.36:445
in the terminal, but it works fine :)
Disciple I presume that as you are talking about win98 it is using raw netbios and not netbios over tcp/ip
I don't know how to figure that out sorry :(

Code: Select all

~# nbtscan 192.168.2.0/24
Doing NBT name scan for addresses from 192.168.2.0/24

IP address       NetBIOS Name     Server    User             MAC address      
------------------------------------------------------------------------------
192.168.2.0     Sendto failed: Permission denied
192.168.2.33     GREEN ROOM       <server>  GREEN ROOM       00-00-00-00-00-00
192.168.2.36     TOMS             <server>  HOOD             00-50-ba-b0-c7-ca

~# nbtscan 192.168.0.0/16
Doing NBT name scan for addresses from 192.168.0.0/16

IP address       NetBIOS Name     Server    User             MAC address      
------------------------------------------------------------------------------
192.168.2.0     Sendto failed: Permission denied
192.168.2.33     GREEN ROOM       <server>  GREEN ROOM       00-00-00-00-00-00
192.168.2.36     TOMS             <server>  HOOD             00-50-ba-b0-c7-ca
The log just says

Code: Select all

Failed to bind: Address already in use
if I just run pnethood.

Sorry - I don't know why I posted the output from when I tried with the router IP address (I wasn't really sure at that stage what you meant by the host - must have worked too long that day :) ).

Here's what I should have posted:

Code: Select all

~# pnethood "192.168.2.36"
timeout connecting to 192.168.2.36:445
timeout connecting to 192.168.2.36:445
timeout connecting to 192.168.2.36:445
/usr/local/pnethood/pnethood: line 150: kill: (2729) - No such process
and the log says

Code: Select all

Scan: subnet 192.168.2.36 complete
timeout connecting to 192.168.2.36:445
timeout connecting to 192.168.2.36:445
timeout connecting to 192.168.2.36:445
192.168.2.36 reports no shares, maybe annonymous scan failed, trying again with password
session request to 192.168.2.36 failed (Called name not present)
session request to 192 failed (Called name not present)
session request to *SMBSERVER failed (Called name not present)
192.168.2.36 still reports no shares, checking mount to see if I have them all mounted already

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#16 Post by HairyWill »

@disciple
aaarrrrggghhh
spaces in netbios names, a good reason to rely on ip addresses
That is going to need some work, at the moment it uses the names to create variables. If anyone knows of a character that is valid in a bash variable but not valid as a netbios name your input would be appreciated. Otherwise I will have to replace spaces with underscores and escape existing underscores with an extra underscore. That's doable.

@davec51
I'd like to help and appreciate the report but need some information
What errors do you get if you run
pnethood
from the console?
What is in /tmp/pnethood-log?
There should be some XML in /tmp/pnethood-gui, posting that might be helpful? The command
ifconfig
should help you find your IP address.
if you replace the last two numbers with zeros and keep the first two as the x.x as below what do you get for
nbtscan x.x.0.0/16
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#17 Post by disciple »

Oh yeah. BTW I was on "Green Room" trying to connect to "Toms" - you know the code, so I guess you'll probably know whether that space is the problem. I imagine it would be a problem if I was trying to connect to a computer with a space in it...
Are you sure you can't just get it working with the right use of quotes, rather than character substitution?
Also, I noticed a while back that if I don't check the option in LinNeighborhood to replace spaces with underscores (I think it does it for netbios names and sharenames), then it still mounted shares OK, but unmounting failed. That was REALLY BAD, and I can't remember if I decided LinNeighborhood or smbunmount was at fault.

I just now tried connecting to Toms from a relatively fresh install of 2.16, (which doesn't have Samba server setup and doesn't identify itself as Green Room) and it works fine, so it's not the network protocols or anything like that. My parents keep trying to keep me off the computer, but I'll try and confirm tomorrow if it's that space, or something else about my system (maybe age or something I've done to it...)

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#18 Post by HairyWill »

thanks disciple I'm getting some useful background from your reports

I hadn't considered that it would also pickup the local samba server. This shouldn't be a problem generally (or for you once the spaces issue is resolved).

My problem with spaces is because I use server names to construct variable names inside the gtkdialog code and also because I have a shell variable containing all the server names. I'm going to work on this Thursday night.

If you think parents get in the way of your 24-7 computing involvement, you should try getting a wife and children. YMMV
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#19 Post by HairyWill »

Now at version 0.4
0.3 was downloaded 36 times

new features
# inbuilt limit of 10 servers scanned, once this limit is exceeded you get a list of all servers and are asked to choose one.
# server and share names with spaces, dots and hyphens should work (only partially tested, may cause name collisions ie: my-server and my_server)
# servers may be specified by IP address
# scan includes every network interface, except ppp ones. I can't see why you would want to scan a ppp interface, it was taking ages and taking down my pptp vpn connection
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#20 Post by Béèm »

Hi HairyWill,

Remember my set up with a WiFi and a 1394 connection.
I get the tab with the PC on which the shares are.
The shares are displayed, but connection to it don't work if I click on one of them. Apparently the corresponding directory in /root/pnethood/.... isn't found.

When I look in info I see:

Code: Select all

scanning network
Scan: 192.168.0.0/16 10.0.0.0/16
probing MD8818
The 10.0.0.0/16 seems ok as my two PC's are on 10.0.0.10 and 10.0.0.11
But 192.168.0.0/16 isn't correct as my PC's are on 192.168.1.2 and 192.168.1.3

It's a pity, the GUI looks nice.

I disabled the WiFi connection to try only the 1394 one, but same result.
Pnethood keeps scanning I think.

I am not sure what I have to enter in userid and password.
In LinNeighborhood I scanned the machine with user root without password.
I tried also to no avail.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

Post Reply