cancel
Showing results for 
Search instead for 
Did you mean: 

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
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.
Fauziah Mahdan
Super Advisor

Re: sftp not working

ok I found the diff when I compare a-z between 2 servers

executable permission for other for file ssh under /opt/ssh is missing for this server
drwxr-x--- 12 bin bin 8192 Oct 22 2008 ssh

After give permission then other user can use sftp.

Infact all file under /opt is without executebale for other compare to another server. No wonder from syslog I found cimserver for this server also not running.

Thanks all.

Viktor Balogh
Honored Contributor

Re: sftp not working

Hi,

let's run an swverify to check if you have other issues...

# swverify \*

This will check if the installed files were modified since the install.

Regards,
Viktor
****
Unix operates with beer.
Fauziah Mahdan
Super Advisor

Re: sftp not working

Ok i found an error for this
ERROR: "CGCAPP4D:/": 1 products are not compatible for this system's
architecture or operating system. If the OS has been updated
since this product was installed, a newer version should be
installed if available.
ERROR: "CGCAPP4D:/": The software dependencies for 46 products or
filesets cannot be resolved.
WARNING: "CGCAPP4D:/": 332 files had warnings during this operation.
ERROR: "CGCAPP4D:/": 37 files had errors during this operation.
* The analysis phase failed for "CGCAPP4D:/".
* Verification had errors.


NOTE: More information may be found in the agent logfile using the
command "swjob -a log CGCAPP4D-0035 @ CGCAPP4D:/".

I will check and look into what file is outdated.

Thanks