1829118 Members
1958 Online
109986 Solutions
New Discussion

sftp

 
Jie Li
Frequent Advisor

sftp

Hi, Folks:

I try to use WinSCP2 to connect to the HP UX server, however I keep getting the message " Error detecting variable containing return code of last command." I have OpenSSH2 installed on the server.

Also I read something about "run SFTP on the server. It is best to run it as a SSH2 subsystem." How do I find out if SFTP is running on the server? How can I run it as a subsystem of SSH2?

Thanks a lot
17 REPLIES 17
Geoff Wild
Honored Contributor

Re: sftp

Did you install "HP Secure Shell"?

ps -ef |grep ssh
root 8615 1 0 Aug 19 ? 0:00 /opt/ssh/sbin/sshd

Release notes:
http://docs.hp.com/hpux/onlinedocs/T1471-90011/T1471-90011.html


Secure Shell can be downloaded here:

http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA

Rgds...Geoff


Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Jie Li
Frequent Advisor

Re: sftp

Yes. The security shell was installed. It is ssh2.
Rick Garland
Honored Contributor

Re: sftp

If the Secure Shell (ssh) is installed and running on the system you will have sftp.

ps -ef | grep ssh

Will return a line indicating sshd if installed and running.

If the package is installed I believe the depot installs in /etc/opt - you should see a ssh directory.


Geoff Wild
Honored Contributor

Re: sftp

If you installed HP's version, you should have:

/sbin/init.d/secsh

It starts in:

/sbin/rc2.d/S393secsh

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Jie Li
Frequent Advisor

Re: sftp

When I do ps -ef | grep ssh, I see:
root 1114 1 0 Aug 9 ? 4:01 sshd

However I couldn't find ssh under /etc/opt.
Jie Li
Frequent Advisor

Re: sftp

Couldn't find:
/sbin/init.d/secsh
/sbin/rc2.d/S393secsh

The ssh we have on the server is OpenSSH2.
Geoff Wild
Honored Contributor

Re: sftp

Okay - so you didn't install HP's version - you will have to check out http://www.openssh.org/

In particular, the FAQ:

http://www.openssh.org/faq.html

There's some info on sftp...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Rick Garland
Honored Contributor

Re: sftp

Look at doing a find

# find / -name "ssh*" -print

This command is not probably not the most efficient search but it will get the job done. Depending on size of system and disks, hopefully won't create much overhead.

Once located you can scan the directory.

One thought is you do not have the ssh directory in your PATH - if it is true that it is not HP's ssh.

From your ps -ef output the daemon is running.
Muthukumar_5
Honored Contributor

Re: sftp

SFTP binary is executed with the sshd(aemon) support. It will be ready when the sshd deamon running there. We can find them with process status command of ps

simply as ps -ef | grep -v grep | grep sshd

And if you want to run the ssh as ssh2 then,

we have to change the sshd_config setting of protocol version as,

protocol 2,1

so that it will work as protocol version 2 first ( ssh2 ) then it will be as 1 if ssh2 can not be executed.

Restart the sshd now! You are ready to run sftp with ssh2 sub system.. that is it.

- Muthu
Easy to suggest when don't know about the problem!
Jie Li
Frequent Advisor

Re: sftp

# find / -name ssh*
/opt/openssh2/man/man1/ssh-add.1
/opt/openssh2/man/man1/ssh-agent.1
/opt/openssh2/man/man1/ssh-keygen.1
/opt/openssh2/man/man1/ssh-keyscan.1
/opt/openssh2/man/man1/ssh.1
/opt/openssh2/man/man8/sshd.8
/opt/openssh2/bin/ssh
/opt/openssh2/bin/ssh-add
/opt/openssh2/bin/ssh-agent
/opt/openssh2/bin/ssh-keygen
/opt/openssh2/bin/ssh-keyscan
/opt/openssh2/etc/ssh_config
/opt/openssh2/etc/ssh_host_dsa_key
/opt/openssh2/etc/ssh_host_dsa_key.pub
/opt/openssh2/etc/ssh_host_key
/opt/openssh2/etc/ssh_host_key.pub
/opt/openssh2/etc/ssh_host_rsa_key
/opt/openssh2/etc/ssh_host_rsa_key.pub
/opt/openssh2/etc/ssh_prng_cmds
/opt/openssh2/etc/sshd_config
/opt/openssh2/sbin/sshd
/var/run/sshd.pid
Jie Li
Frequent Advisor

Re: sftp

I saw the following in my config file for SSH.
"Subsystem sftp /opt/openssh2/libexec/sftp-server" I know we are on SSH2, and we have been using SSH2 client successfully for a long time. It just won't work with the sftp client(WinSCP2) on my pc. Would you please recommend a client to me?
Rick Garland
Honored Contributor

Re: sftp

On the WIN side, what SSH application are you using?

There is putty that has the sftp and scp and ssh clients all there. They are called different names but it is still a free download.
Jie Li
Frequent Advisor

Re: sftp

WinSCP2, I think it is a putty.
Rick Garland
Honored Contributor

Re: sftp

Will 'scp' transfers work?
Jie Li
Frequent Advisor

Re: sftp

I couldn't get it to work. When I try use it to connect to the server, the error message says "Error detecting variable containing return code of last command."
Jie Li
Frequent Advisor

Re: sftp

Ok I downloaded a new version of SFTP client. Now it gave me another error message:
"Cannot get real path for '.'.
Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 16"

Jie Li
Frequent Advisor

Re: sftp

It is working now.

Thanks for all your help.