In our LAN are some computers running Windows with a firewall which blocks port 445. So the programs smbclient and smbmount are waiting for a long time for aan answer at this port which never arrive. To overcome this I have written two wrapper scripts which work very well (for me):
smbclient:
-- begin
#!/bin/sh
/usr/bin/smbclient "$@" -k -p 139
-- end
smbmount:
--begin
#!/bin/sh
SMBPAR=""
OPTPAR=0
OPTCNT=0
for PAR in $@; do
if [ $OPTPAR -eq 0 ]; then
SMBPAR="$SMBPAR $PAR"
else
for (( I=1; I<10; I=I+1 )); do
SUBPAR=`echo $PAR | cut -d ',' -f $I`
if [ "$SUBPAR" == "" ]; then
break
fi
NAME=`echo $SUBPAR | cut -d '=' -f 1`
if [ "$NAME" != "workgroup" ] && [ "$NAME" != "ip" ] && [ "$NAME" != "krb" ]; then
if [ $OPTCNT -gt 0 ]; then
SMBPAR="$SMBPAR,$SUBPAR"
else
SMBPAR="$SMBPAR $SUBPAR"
OPTCNT=1
fi
fi
done
fi
if [ "$PAR" == "-o" ]; then
OPTPAR=1
fi
done
if [ $OPTPAR -eq 0 ]; then
SMBPAR="$SMBPAR -o port=139"
else
if [ $OPTCNT -eq 0 ]; then
SMBPAR="$SMBPAR port=139"
else
SMBPAR="$SMBPAR,port=139"
fi
fi
/usr/bin/smbmount $SMBPAR,sockopt="SO_SNDBUF=8192,SO_RCVBUF=8192,gue st"
-- end
Just create two file smbclient and smbmount in /usr/local/bin and make them executable. You can still use the original programs. You just have to specify the full path.
By the way a very good program for viewing Windows and samba shares is smb4k. Would be nice to have it on a Knoppix CD.
HP ProLiant BL460c G9 (Gen9) 2x E5-2670V3 12 Core 3.1GHz No Ram or No Drives
$59.98
Cisco UCS 5108 Blade Server Chassis Enclosure 8x B200 M4 16x E5-2640v3 128gb
$599.99
DELL PEM640 POWEREDGE M640 BLADE SERVER
$539.95
Dell PowerEdge FX2s CTO Blade 4 Slot 2U Chassis 2x 2000W
$399.00
HPe D2220sb c-CLASS 10-SLOT SFF DIRECT ATTACHED STORAGE BLADE 7.2TB 10K SAS SFF
$139.99
HP Proliant BL460C Gen8 Blade Server 2x 8C E5-2690 192GB Ram
$58.54
727021-B21 HP ProLiant BL460c G9(Gen9) E5 10Gb FlexibleLOM CTO Blade Server
$66.00
Google Search Appliance - Dell PowerEdge R710 x2 Xeon X5690 192GB Memory 6TB HDD
$529.99
Cisco UCS 5108 Blade Server Chassis Enclosure N20-C6508 4x PSU 8x Fans 2x Fabric
$139.99
DELL PowerEdge M630 Blade 2x E5-2683v3 2.0GHz =28 Cores 128GB H330 2x10Gb X520
$290.00