LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2020, 08:55 AM   #1
riscxman
LQ Newbie
 
Registered: Dec 2009
Location: Gaydon Warwickshire UK
Distribution: Raspian
Posts: 5

Rep: Reputation: 0
Question Is there a command to show what SMB shares are active?


Hello, this is my first post for a while (2009) so am posting in newbies. I hope to be more active in the future.

My question is in the Subject line.

I have tried smbstatus but this gives a view of the shares from the client perspective.

What I want is a command that shows what my server is offering to the world. The smb.conf file probably has the data but I would like a simple command line way of showing it.
 
Old 12-13-2020, 09:06 AM   #2
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,366

Rep: Reputation: 4082Reputation: 4082Reputation: 4082Reputation: 4082Reputation: 4082Reputation: 4082Reputation: 4082Reputation: 4082Reputation: 4082Reputation: 4082Reputation: 4082
Only for active shares:
Code:
root:~/ # smbstatus -S                                                                                                                                         
Service      pid     Machine       Connected at                     Encryption   Signing     
---------------------------------------------------------------------------------------------
IPC$         57004   192.168.111.13 dim. déc. 13 16:06:15 2020 CET  -            -           
doc          57004   192.168.111.13 dim. déc. 13 16:06:16 2020 CET  -            -

Last edited by marav; 12-13-2020 at 09:07 AM.
 
Old 12-13-2020, 11:36 AM   #3
riscxman
LQ Newbie
 
Registered: Dec 2009
Location: Gaydon Warwickshire UK
Distribution: Raspian
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by marav View Post
Only for active shares:
Code:
root:~/ # smbstatus -S                                                                                                                                         
Service      pid     Machine       Connected at                     Encryption   Signing     
---------------------------------------------------------------------------------------------
IPC$         57004   192.168.111.13 dim. déc. 13 16:06:15 2020 CET  -            -           
doc          57004   192.168.111.13 dim. déc. 13 16:06:16 2020 CET  -            -
Sorry that is not what I meant. I want to display details of the resources that are being offered to clients, not what machines are connected to me.
Eg - Server name, directory path, user, and anything else that a client machine needs to know to be able to connect.
 
Old 12-13-2020, 12:12 PM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
smbclient -L, perhaps? But it requires the server name to be specified.
 
1 members found this post helpful.
Old 12-13-2020, 12:58 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,716

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Quote:
Originally Posted by shruggy View Post
smbclient -L, perhaps? But it requires the server name to be specified.
Indeed, and from the server itself you can use localhost, host name or IP address i.e

smbclient -L localhost

Depending on distribution smbclient is a separate package and may not be installed by default.

If you press enter without entering a password you will see all the browseable shares and printers. Otherwise to see private shares like your home you need to enter a valid samba username and password.

As a standalone server the "things" you need to know to connect are samba user, samba password, net bios server name if different from hostname or IP address and share name.

knowing what is a public or a guest share that does not require a username password depends on how samba is configured. Depends on a few share and global directives.

Last edited by michaelk; 12-13-2020 at 01:05 PM.
 
1 members found this post helpful.
Old 12-13-2020, 01:02 PM   #6
riscxman
LQ Newbie
 
Registered: Dec 2009
Location: Gaydon Warwickshire UK
Distribution: Raspian
Posts: 5

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by shruggy View Post
smbclient -L, perhaps? But it requires the server name to be specified.
Thanks - I had to install smbclient first but the command with -L option does what I wanted
 
  


Reply

Tags
command line, smb



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SMB Shares dont work when SMB is run as a service! CentOS 6 finnsloss Linux - Networking 1 10-14-2011 09:33 AM
smb mount folders disappear on mount & konqueror smb fails: network unreachable tisource Linux - Networking 1 10-17-2007 12:30 AM
smb+KDE= :-) smb+Gnome= :-( awing_pilot Linux - Software 3 03-10-2005 10:38 PM
Creating a SSL connection from smb clients to a smb server scottpioso General 0 11-17-2003 02:33 PM
making smb shares viewable from smb client via web browser scottpioso General 3 11-10-2003 04:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration