1753312 Members
6526 Online
108792 Solutions
New Discussion юеВ

Re: sftp not working

 
Fauziah Mahdan
Super Advisor

sftp not working

Dear all,
If i run sftp and nothing comes out. What should I check?
12 REPLIES 12
James R. Ferguson
Acclaimed Contributor

Re: sftp not working

HI:

> If i run sftp and nothing comes out. What should I check?

Is the IP address valid? Can you ping it?

Regards!

...JRF...
Fauziah Mahdan
Super Advisor

Re: sftp not working

# ping 172.16.0.46
PING 172.16.0.46: 64 byte packets
64 bytes from 172.16.0.46: icmp_seq=0. time=0. ms
64 bytes from 172.16.0.46: icmp_seq=1. time=0. ms

----172.16.0.46 PING Statistics----
2 packets transmitted, 2 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0
# sftp 172.16.0.46

No prob with the destination ip. The problem is sftp itself not work.
Even if I type sftp without ip, it will prompt to #

For working sftp if I type sftp it will appear
# sftp
Usage: sftp [options] user@host[:file [file]]
Options:
-1 Specify the use of protocol version 1.
-B buffer_size Specify the size of the buffer that sftp uses when transferring files.
-b batchfile Batch mode reads a series of commands from an input batchfile instead of stdin.
-C Enables compression.
-F ssh_config Specifies an alternative per-user configuration file for ssh.
-o ssh_option Used to pass options to ssh in the format used in ssh_config file.
-P sftp_server_path Connect directly to a local sftp server (rather than via ssh).
-R num_requests Specify how many requests may be outstanding at any one time.
-S program Specifies the SSH2 subsystem or the path for an sftp server on the remote host.
-s subsystem|sftp_server program Name of program to use for the encrypted connection.
-v Verbose mode.
#

Steven Schweda
Honored Contributor

Re: sftp not working

> [...] What should I check?

For a start:

uname -a

> Even if I type sftp without ip, it will
> prompt to #

What are you running?

type sftp

> For working sftp [...]

Compare the results between the two systems.
Fauziah Mahdan
Super Advisor

Re: sftp not working

This is the result from non working sftp
# uname -a
HP-UX CGCAPP4D B.11.31 U ia64 1511113692 unlimited-user license
# sftp
#

Fauziah Mahdan
Super Advisor

Re: sftp not working

my 2nd reply wass showing the result for working sftp.
Sorry for typo.
Patrick Wallek
Honored Contributor

Re: sftp not working

At the prompt do:

# type sftp

Note that 'type' is a command. Do just as it appears above.

Check the size of the 'sftp' executable as well. It could have somehow gotten corrupted.
Fauziah Mahdan
Super Advisor

Re: sftp not working

Yes sftp size is 0
# type sftp
sftp is /usr/bin/sftp
# ll /usr/bin/sftp
lrwxr-xr-x 1 root sys 17 Oct 22 2008 /usr/bin/sftp -> /opt/ssh/bin/sftp
# cd /opt/ssh/bin
# ll
total 8192
-rwxr-xr-x 1 bin bin 280392 Jun 2 2008 scp
-rwxrwxr-x 1 bin bin 0 Mar 8 16:53 sftp
lrwxr-xr-x 1 root sys 16 Oct 22 2008 slogin -> /opt/ssh/bin/ssh
-rwxr-xr-x 1 bin bin 1378744 Jun 2 2008 ssh
-rwxr-xr-x 1 bin bin 561280 Jun 2 2008 ssh-add
-rwxr-xr-x 1 bin bin 489348 Jun 2 2008 ssh-agent
-rwxr-xr-x 1 bin bin 630208 Jun 2 2008 ssh-keygen
-rwxr-xr-x 1 bin bin 835388 Jun 2 2008 ssh-keyscan
Patrick Wallek
Honored Contributor

Re: sftp not working

>>-rwxrwxr-x 1 bin bin 0 Mar 8 16:53 sftp

Here's your problem. The sftp binary is 0 bytes in size. You need to restore it from a backup.
Fauziah Mahdan
Super Advisor

Re: sftp not working

Ok done now as root I can sftp but not as other user.
Where to set permission? I have compare with other server no diff.