If I want to find out how the hostname of a remote linux machine on my LAN is, how can I achieve this given I don't have access via SSH etc.?
Probably depends if linux is part of a WINS domain I suppose.
You'd have to specify the term hostname more closely. If you are looking for the name as it is known to the DNS server that you don't want to use - there is no way of knowing except for actually asking that DNS server.
If you are simply guessing, nmap can be of good use. For example, if there is a smbd running on that server, the output of
Other services might give hints about the name of the machine as well.
In the absence of a DNS server, this might work:
Alternatively, if the server in question is exporting Samba shares, you could do this:
This depends on whether you have a working DNS server set up on your LAN that has the necessary information. If it does, this command should do what you need:
Finally, another useful command is
Fingerd (and xinetd) are easy to set up and require no maintenance.
$ finger firstname.lastname@example.org [10.3.0.3:79] Welcome to Linux version 3.5.7-12-tryggve at tryggve.lan ! (...)