List Windows Shares On Linux Script
Page 1 of 1
List Windows Shares On Linux Script
Vid
- Code:
#!/bin/bash
# (c) J~Net 2019
#
# https://jnet.forumotion.com/t1653-list-windows-shares-on-linux-script#2544
#
#server="192.168.10.100"
server="server"
workgroup="WORKGROUP"
debug="1" # 3 is default
#
echo "J~NET Remote Windows Network Server Shares:"
echo "Enter Username: (Leave Blank For Current Username)"
read username
#
if [ -z "$username" ]
then
username=$(whoami)
else
echo "\$username Is The Selected Username."
fi
#
echo "Enter User's Password"
#
smbclient -d$debug -U="$username" -W="$workgroup" -L="$server"
#
echo "Enter Share Name: (Leave Blank For default share name aka network)"
read sharename
if [ -z "$sharename" ]
then
sharename="network"
else
echo "\$sharename Is The Selected Share Name."
fi
echo "Now navigate to location "
echo "smb://$username@$server/$sharename/"
echo ""
echo "Where $networkshare is the network share name!"
dolphin smb://$username@$server/$sharename/ # This is a custom line and is static not dynamic
#
Re: List Windows Shares On Linux Script
Also
you will need dolphin installed
you will need dolphin installed
- Code:
apt install -y dolphin
Re: List Windows Shares On Linux Script
If you cant browser network shares even after this you may need to setup your linux as follows first!
Fixing net share browser
Edit /etc/samba/smb.conf
and right under the workgroup = WORKGROUP line add this one:
Fixing net share browser
Edit /etc/samba/smb.conf
- Code:
gedit /etc/samba/smb.conf
and right under the workgroup = WORKGROUP line add this one:
- Code:
client max protocol = NT1
Re: List Windows Shares On Linux Script
A Script To Help If All Else Fails!
- Code:
#!/bin/bash
# (c) J~Net 2019
#
# https://jnet.forumotion.com/t1653-list-windows-shares-on-linux-script#2544
#
#server="192.168.1.30"
server="server"
workgroup="WORKGROUP"
debug="1" # 3 is default
#
echo "J~NET Remote Windows Network Server Shares:"
echo "Enter Username: (Leave Blank For Current Username)"
read username
#
if [ -z "$username" ]
then
username=$(whoami)
else
echo "\$username Is The Selected Username."
fi
#
echo "Enter User's Password"
#
smbclient -d$debug -U="$username" -W="$workgroup" -L="$server"
#
echo "Enter Share Name: (Leave Blank For default share name aka network)"
read sharename
if [ -z "$sharename" ]
then
sharename="network"
else
echo "\$sharename Is The Selected Share Name."
fi
echo "Now navigate to location "
echo "smb://$username@$server/$sharename/"
echo ""
echo "Where $networkshare is the network share name!"
dolphin smb://$username@$server/$sharename/ # This is a custom line and is static not dynamic
#
Similar topics
» Linux Command List
» Access Windows Shares From BASH In Linux
» windows xp and linux samba sharing folder shares
» how to setup samba for linux config and allowing linux shares and adding users to samba commands
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» Access Windows Shares From BASH In Linux
» windows xp and linux samba sharing folder shares
» how to setup samba for linux config and allowing linux shares and adding users to samba commands
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum