PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

List Windows Shares On Linux Script

Go down

List Windows Shares On Linux Script Empty List Windows Shares On Linux Script

Post by jamied_uk 25th September 2018, 12:18

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
    #
jamied_uk
jamied_uk
Admin

Posts : 2950
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

List Windows Shares On Linux Script Empty Re: List Windows Shares On Linux Script

Post by jamied_uk 23rd December 2019, 19:37

Also



you will need dolphin installed


Code:
apt install -y dolphin
jamied_uk
jamied_uk
Admin

Posts : 2950
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

List Windows Shares On Linux Script Empty Re: List Windows Shares On Linux Script

Post by jamied_uk 23rd December 2019, 20:03

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

Code:
gedit /etc/samba/smb.conf

and right under the workgroup = WORKGROUP line add this one:

Code:
client max protocol = NT1
jamied_uk
jamied_uk
Admin

Posts : 2950
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

List Windows Shares On Linux Script Empty Re: List Windows Shares On Linux Script

Post by jamied_uk 2nd February 2020, 10:49

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
    #
jamied_uk
jamied_uk
Admin

Posts : 2950
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

List Windows Shares On Linux Script Empty Re: List Windows Shares On Linux Script

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum