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 Z440 WORKSTATION XEON E5-1603V3 @ 2.80GHz, 16GB RAM 250 GB SSD Win 11
$119.99
HP Z420 Workstation Xeon E5-2690 v2 3ghz 10-Cores 64gb 240gb SSD 1TB Win10
$109.99
Lenovo Thinkstation P510 E5-1620 V4 16GB RAM 512GB SSD DVD Quadro M2000 W10 Pro
$164.95
Dell Precision 5810 Workstation Xeon E5-1650 6C 3.5GHz 16GB 500GB Win10 K2200
$124.67
Intel Xeon E5-2697A V4 2.6GHz CPU Processor 16-Core Socket LGA2011 SR2K1
$39.99
SR1XP Intel Xeon E5-2680 v3 12 Core 30MB 2.5GHz LGA 2011-3 Grade A Processor
$5.29
Intel Xeon E5-2697 V4 2.30 GHz 18C 2011-3 2400MHz 45MB 145W SR2JV CPU Processor
$49.99
Intel Xeon Gold 6140 SR3AX 2.3GHz 18-Core Processor CPU
$39.99
HP Z820 Workstation 20-Core 2.50GHz E5-2670 v2 128GB No HDD No OS
$284.89
HP Z640 Desktop Server Xeon E5-2620 v3 32GB DDR4 RDIMM Quadro K2200 1TB SSD
$199.99