- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ssh picking up wrong IP
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2011 10:42 AM
09-10-2011 10:42 AM
I am running HP-UX 11.31 and trying to do an ssh from one server to another, but it is picking up
the wrong IP address...
I have the host coded in /etc/hosts file:
192.168.172.42 odcign1-0
and nslookup shows it correctly:
=>nslookup odcign1-0
Using /etc/hosts on: tmovdb02
looking up FILES
Name: odcign1-0
Address: 192.168.172.42
=>
The /etc/nsswitch.conf file also specifies to check hosts first:
hosts: files [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] dns
But when I do an ssh it is picking up an old IP from dns, and not using hosts file entry...
=>ssh -v odcign1-0
OpenSSH_5.6p1+sftpfilecontrol-v1.3-hpn13v7, OpenSSL 0.9.8o 01 Jun 2010
HP-UX Secure Shell-A.05.60.003, HP-UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug1: Connecting to odcign1-0 [192.168.223.160] port 22.
debug1: connect to address 192.168.223.160 port 22: Connection refused
ssh: connect to host odcign1-0 port 22: Connection refused
=>
Any ideas as to why ?? I've requested our network group to remove the enty from DNS, but that could take
a few days....
Solved! Go to Solution.
- Tags:
- ssh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2011 02:46 AM
09-12-2011 02:46 AM
SolutionDo you have a file named like ~/.ssh/config in the home directory of the user running the "ssh" command? The old IP address might be defined in there, with something like:
Host odcign1-0 HostName 192.168.223.160
The system-wide SSH client configuration file, /opt/ssh/etc/ssh_config might contain similar settings too.
Also make sure that the user running the ssh command is allowed to read /etc/hosts, /etc/nsswitch.conf and /etc/resolv.conf. I've seen cases where some of these files have been restricted to root only, causing the hostname lookup use unexpected sources. (For example, if /etc/nsswitch.conf is not readable for non-root users, their hostname resolution will use the factory default order: first DNS, then NIS (if configured) and /etc/hosts as the last source, as documented in the example file /etc/nsswitch.hp_defaults.)
- Tags:
- Permission