0

What is the most effective way to check Samba server availability from a Linux client?

atevm
  • 359
  • 1
  • 2
  • 10
  • 1
    `telnet 139` or `nmap -p 139 ` should do it. For telnet if you get the message 'telnet: Unable to connect to remote host: Connection refused' then the host does not expose samba to you. see more info on how to test port TCP\139 here: http://superuser.com/questions/769541/is-it-possible-to-ping-an-addressport – Frank Thomas Jan 28 '16 at 14:44

1 Answers1

2

As the comment suggests, test to see if the port is open. But instead of "telnet", using "nc" to just test if the port is open is much easier to check the result:

 nc -z remotehost 139 && echo up || echo down
PBI
  • 311
  • 1
  • 3
  • Thanks @PBI your advice is much more convenient than, what I used: nmap -p $port $ip | grep --quiet -e "^[0-9]*[/tcpudp ]*closed" :) – atevm Feb 01 '16 at 13:31