Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

sftp on openvms

 
Highlighted
New Member

sftp on openvms

Could someone please post an example of using sftp in batch mode on openvms.

we are running
HP TCP/IP Services for OpenVMS Alpha Version V5.4 - ECO 5
on a AlphaServer 1200 5/400 4MB running OpenVMS V7.3-2
28 REPLIES 28
Highlighted
Honored Contributor

Re: sftp on openvms

Bill,

try this...

$ sftp -bbatch_file username@host

try this also
$sftp -bbatch_file 'usrname':'psswrd'@'node'

Archunan
Regards
Archie
Highlighted
Honored Contributor

Re: sftp on openvms

Bill,

this is SFTP cmnd Synopsis, you can give the necessary options if you know.

$ SFTP [-D ] [-b batchfile] [-S path][-h][-v] [-P ssh-port] user@host

-D debug-level Displays debug information. The debug-level value is a number between 0
and 99

-b batchfile Reads commands from a file instead of from SYS$INPUT.

-S ssh-path Specifies an alternate location for the SSH server executable file.

-h Displays information about how to use the SFTP utility.

-V Displays the version of SSH.

-P Tells SFTP on which port the SSH server is listening.
Regards
Archie
Highlighted
Honored Contributor

Re: sftp on openvms

You will probably have to set up public key or host based authentication for batch mode to work.
Highlighted
Honored Contributor

Re: sftp on openvms

Bill,

using SFTP from batch mode requires more than just knowing how to specify the options for the SFTP command...

I've found the following manual to best provide the necessary pieces of information:

http://h71000.www7.hp.com/openvms/products/ssh/ssh.pdf

I've followed the different chapters in this manual and have successfully set up the environment to run SFTP from a DCL procedure interactively (no prompt for password) with using user-based public key authentication.

For BATCH mode, host based authentication seems to be necessary, as you can't run an SSH_AGENT in batch mode. The SSH_AGENT is required to ask for and store the passphrase for the user's key file(s).

Once I'll get this running, I'll provide and describe the necessary steps (for TCPIP V5.5). There's a long weekend ahead, isn't it ;-)

Volker.
Highlighted
Honored Contributor

Re: sftp on openvms

Bill,

it works well with TCPIP V5.5. I've done the setup based on the 'HP TCP/IP Services for OpenVMS Guide to SSH (TCPIP V5.4)' manual referenced above.

Here are my notes from the setup and an example BATCH procedure and logfile:


Setting up HOSTBASED Authentication
===================================

On SSH Client:

in TCPIP$SSH_DEVICE:[TCPIP$SSH.ssh2]SSH2_CONFIG.

DefaultDomain domain.name ! make sure to enter full domain name of local node


On SSH Server:

TCPIP$SSH_DEVICE:SSHD2_CONFIG.

AllowedAuthentications hostbased, publickey, password


TCPIP$SSH_DEVICE:SHOSTS.EQUIV

fully-qualified-client-IP-name username

NOTE: use lowercase username for OpenVMS clients


Copy from SSH Client

TCPIP$SSH_DEVICE:[TCPIP$SSH.ssh2]hostkey.pub

to SSH Server

TCPIP$SSH_DEVICE:[TCPIP$SSH.ssh2.KNOWNHOSTS]fully_qualified_client_SSH-DSS.PUB

e.g. NODE_DOMAIN_NAME_SSH-DSS.PUB (for client node node.domain.name)


Using SFTP from BATCH mode
==========================

Use TCPIP V5.4 ECO 5 or TCPIP V5.5


$ sftp "-B" "/userdisk1/halle/itrc/bf.ftp" hostname


Batchfile USERDISK1:[HALLE.ITRC]BF.FTP:

ls login.com[lf]
cd [.itrc][lf]
get x.x[lf]

NOTE: [lf] = each line needs to be terminated by [LF] character = ASCII 10.
In TPU: [GOLD]10[GOLD][SPEC INS]
or the file needs to be converted to STREAMLF record format

NOTE: Files to be copied etc. by SFTP need to be in STREAMLF format:
$ set file/attr=rfm:stmlf x.x


Batch logfile:

$ sftp "-B" "/userdisk1/halle/itrc/bf.ftp" hostname
sftp> ls login.com
login.com

/userdisk1/halle/itrc

x.x | 0 kB | 0.0 kB/s | TOC: 00:00:01 | 100%


Merry Christmas and a Happy New Year,

Volker.
Highlighted
Honored Contributor

Re: sftp on openvms

Correction:

...

On SSH Server:

TCPIP$SSH_DEVICE:[TCPIP$SSH.SSH2]SSHD2_CONFIG.

AllowedAuthentications hostbased, publickey, password


TCPIP$SSH_DEVICE:[TCPIP$SSH.SSH2]SHOSTS.EQUIV

fully-qualified-client-IP-name username

NOTE: use lowercase username for OpenVMS clients

...

Volker.
Highlighted

Re: sftp on openvms

Hi All,

I need to connect to an IP through SFTP from VMS. I have the user name password and the IP. I need to find out whether the file is present or not.
I tried like this

sftp user_name@host password

But it throwed the below error:
Too many arguments.
Usage: sftp2 [-D debug_level_spec] [-B batchfile] [-S path] [-h]
[-V] [-P port] [-b buffer_size]
[-4] [-6] "[-C]" [-o option_to_ssh2]
[user@]host[#port]


Please Help me out.
Highlighted
Honored Contributor

Re: sftp on openvms

The clear text error tells You "Too many arguments".
There is no such argument "password" on the sftp command-line, only user@host.
When sftp starts, it will prompt for the password , unless You have a public key established.
http://www.mpp.mpg.de/~huber
Highlighted

Re: sftp on openvms

Hi,

When i try sftp user@host it is throwing the below error:

Usage: /sys$system/tcpip$ssh_ssh2 [POSIX or GNU style options] -f progfile [--] file ...
/sys$system/tcpip$ssh_ssh2 [POSIX or GNU style options] [--] "program" file ...
POSIX options: GNU long options:
-f progfile --file=progfile
-F fs --field-separator=fs
-v var=val --assign=var=val
-m[fr]=val
-W compat --compat
-W copyleft --copyleft
-W copyright --copyright
-W help --help
-W lint --lint
-W posix --posix
-W source=program-text --source=program-text
-W usage --usage
Warning: child process (/sys$system/tcpip$ssh_ssh2) exited with code 44.


%TCPIP-E-SSH_FC_ERROR, error in ssh file transfer operation