0

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

  • 1
    telnet <remotehostname> 139 or nmap -p 139 <remotehostname> 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: superuser.com/questions/769541/… – Frank Thomas Jan 28 '16 at 14:44
1

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
  • 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 1 '16 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.