Solved

How to get the remote hostname

Posted on 2006-10-21
2
203 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Occasionally Windows/Microsoft Updates will fail to update. We have found a code that will delete all temporary files and re-register all dll's related to Windows/Microsoft Updates! This works 99% of the time to get the updates working again! The…
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.

815 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now