Solved

How to get the remote hostname

Posted on 2006-10-21
2
207 Views
Last Modified: 2007-12-19

Hi group,

machine A has a connection to macine B.

It is possible to run some command on machine B as you are on machine A such as:

# ssh  10.0.27.254  ls
# ssh  10.0.27.254  mkdir aDir

but when I do

# ssh 10.0.27.254  echo $HOSTNAME  it doesn't print the name of the remote machine (B)

How can I get that information?

Thanks,
0
Comment
Question by:akohan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 58

Accepted Solution

by:
amit_g earned 100 total points
ID: 17779279
Use command hostname ...

ssh 10.0.27.254  hostname
0
 
LVL 58

Expert Comment

by:amit_g
ID: 17779468
Why B?
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just about everyone has an old PC laying around.  Ask anyone in the IT industry, whether they are a professional or play in it as a hobby.  From outdated Desktops to cheap "throwaway" laptops, they are all around and not as hard to "fix up" as you m…
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question