10

I don't know if Samba is pre-installed in my Linux system.

I have the /etc/samba/ directory, with smb.conf file. But if I try one of these commands

sudo service smb start
sudo service samba start
sudo service smbd start

the answer is always unrecognized service.

In /etc/init.d there is no file like smb, samba or smbd. How could I check anymore?

Thank you anyway!

BowPark
  • 4,811
  • 12
  • 47
  • 74

4 Answers4

11

The easier way is to check with your package manager. dpkg, yum, emerge, etc. If that doesn't work, you just need to type samba --version and if it's in your path it should work. Lastly you can use find / -executable -name samba to find any executable named samba. If those test are negative, is highly probable that you don't have samba installed.

Braiam
  • 35,380
  • 25
  • 108
  • 167
  • The commands relevant for the current Fedora release (25) are `rpm --query samba`, `dnf list installed samba`, `smbd --version`, and `find /usr/sbin/ -executable -name smbd`. The command to check the service is `systemctl status smb`. – Bob May 29 '17 at 13:46
6

In SMB version 4.11.6-Ubuntu, run the following command:

systemctl status smbd
user311086
  • 161
  • 1
  • 5
1

Use the smbstatus command

you see below. version 3.6.23-14.el6_6 and status of you samba process and user, group etc...

dipak
  • 11
  • 1
0

There is an even easier way to check for installed programs. You can check for any installed program by typing:

~$ which [program]

So in this case

~$ which samba

If it is installed, it gives you the location of it. If it isn't, you get an empty output.

  • 1
    That won't work in this case as there's no file named `samba`. `which smbd` would show if the server is installed -- but only if `/usr/sbin` is in the user's PATH. – Anthony Geoghegan May 30 '17 at 13:17