Showing results for 
Search instead for 
Did you mean: 

SFTP not working

Occasional Advisor

SFTP not working

hello everyone.


i have problem with sftp 


Connecting to idcadm1...
OpenSSH_4.3p2-hpn, OpenSSL 0.9.7i 14 Oct 2005
HP-UX Secure Shell-A.04.30.014, HP-UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config


it is not proceeding after this stage .. can you help me 

Honored Contributor

Re: SFTP not working

At that point, sftp is trying to:

a) look up the IP address of the remote host

b) connect to the SSH port of the remote host.


If the hostname was "idcadm1", run "nslookup idcadm1" to see if your system can resolve an IP address for it. The command should normally return very quickly. If it takes a long time, your system is probably configured to use an unreachable or non-functional DNS server: verify that your /etc/resolv.conf and /etc/nsswitch.conf files have correct settings, then troubleshoot DNS server connectivity.


If DNS is not available, you can add the IP address of idcadm1 to /etc/hosts as a workaround.


Then see if you can establish a generic TCP connection to the SSH port of the remote host. Run "telnet idcadm1 22". If it says "Connection established", basic network connectivity is OK. If sftp still does not work, the remote server may be overloaded or having other problems with its sshd daemon.


If the telnet command returns immediately with "Connection refused", the remote server may not have a sshd daemon running, or there might be a firewall between you and the remote server that is configured to *reject* your connections. Contact the remote server admin to make sure sshd is running and that the remote server is not blocking you. If that is not the cause, troubleshoot with a network administrator.


If the telnet command hangs for about a minute and then returns with "Connection timed out", there may be a network problem between you and the remote server, or a firewall that is configured to *drop* your connections without sending a rejection reply (this is the more common configuration with firewalls). Troubleshoot with a network admin.

Occasional Advisor

hi,   when i do sftp to localhost it struck at same point...



when i do sftp to localhost it struck at same point




Honored Contributor

Re: hi, when i do sftp to localhost it struck at same point...

Does it get stuck if you run "sftp"?


Even the name "localhost" needs to be converted into an IP address before sftp can start setting up the connection. If your hostname resolution settings are not correct, the system may be wasting time trying to look up the name "localhost" from a non-functional DNS server, instead of looking into /etc/hosts.


Also sftp and ssh are IPv6-aware programs: in HP-UX, it means they are using the "ipnodes:" line of /etc/nsswitch.conf, not the "hosts:" line as you might expect. If /etc/nsswitch.conf does not exist or does not contain the "ipnodes:" line, the factory default is to first try DNS, then fall back to /etc/hosts. If your /etc/resolv.conf specifies a DNS nameserver but that server fails to answer, it might cause a problem just like yours.