can't open /dev/tty: EDC5128I No such device.

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
wtbourg
Posts: 3
Joined: Thu Aug 08, 2013 9:11 am

can't open /dev/tty: EDC5128I No such device.

Post by wtbourg »

Having an issue with trying to pull a file from one z/os lpar to another.

Batch sftp job loops until canceled, producing the following messages:

fromdsn(WTBOURG.PASSWD(SITE1))[N]: 1 records/80 bytes read; 9 bytes written in 0 milliseconds.
debug1: read_passphrase: can't open /dev/tty: EDC5128I No such device. (errno2=0x056201A9)

debug1: permanently_drop_suid: 30000411

JCL :
//SFTPGET EXEC PROC=SFTPPROC
//SFTPIN DD *
sftp_opts="-vvv"
pwdsn="WTBOURG.PASSWD(SITE1)"
user=WTBOURG
port=2222
host=PLEXDEV
lzopts="MODE=TEXT,L=NL"
lfile=//DD:MYDD
rfile=/DEV1/tmp/cjpete8/test/testfile

. $script_dir/sftp_get.sh

//MYDD DD DSN=WTBOURG.COZ.TEST,DISP=(NEW,KEEP),
// DCB=(LRECL=80,RECFM=FB),SPACE=(CYL,(3,1)),
// STORCLAS=NGSBASE


Output:
CoZBatch[N]: Copyright (C) 2005-2013 Dovetailed Technologies LLC. All rights reserved.
CoZBatch[N]: version 2.4.1 2013-06-24
CoZBatch[D]: stdin file opened: //DD:STDIN
CoZBatch[D]: stdout file using DD SYSOUT
CoZBatch[D]: stderr file using DD SYSOUT
CoZBatch[D]: region size requested = 65536K, Actual below/above limit = 11240K / 65536K
CoZBatch[D]: geteuid=30000411
CoZBatch: executing progname=login-shell="-/bin/sh"
CoZBatch[D]: spawning progname=/bin/sh
CoZBatch[D]: argv[0] = -/bin/sh
CoZBatch[D]: current environment:
CoZBatch[D]: >TZ=CST6CDT,M3.2.0/02:00:00,M11.1.0/02:00:00<
CoZBatch[D]: >LIBPATH=/lib:/usr/lib:.<
CoZBatch[D]: >_EDC_ADD_ERRNO2=1<
CoZBatch[D]: >HOME=/<
CoZBatch[D]: >LOGNAME=WTBOURG<
CoZBatch[D]: >_BPX_SHAREAS=MUST<
CoZBatch[D]: >_BPX_SPAWN_SCRIPT=YES<
CoZBatch[D]: >_BPXK_JOBLOG=STDERR<
CoZBatch[D]: >PATH=/bin:/usr/bin<
CoZBatch[D]: spawned /bin/sh (65802)
Connect using SSH_ASKPASS, password will be read from WTBOURG.PASSWD(SITE1)...
Executing: /usr/lpp/coz/bin/cozsftp -oBatchMode=no -vvv -oPort=2222 -b- 'WTBOURG@PLEXDEV'
Co:Z SFTP version: 2.4.1 (5.0p1) 2013-06-24
Copyright (C) Dovetailed Technologies, LLC. 2008-2013. All rights reserved.
ZosSettings[W]: error reading configuration file (//.ssh/cozsftp_config) - EDC5047I An invalid file name was specified
as a function parameter. (errno2=0xC00B0286)
[10.822] debug3: connect_to_server arg=/bin/ssh
[10.822] debug3: connect_to_server arg=-oForwardX11 no
[10.822] debug3: connect_to_server arg=-oForwardAgent no
[10.822] debug3: connect_to_server arg=-oClearAllForwardings yes
[10.822] debug3: connect_to_server arg=-oBatchMode=no
[10.822] debug3: connect_to_server arg=-v
[10.822] debug3: connect_to_server arg=-v
[10.822] debug3: connect_to_server arg=-v
[10.822] debug3: connect_to_server arg=-oPort=2222
[10.822] debug3: connect_to_server arg=-obatchmode yes
[10.822] debug3: connect_to_server arg=-lWTBOURG
[10.822] debug3: connect_to_server arg=-oProtocol 2
[10.822] debug3: connect_to_server arg=-s
[10.822] debug3: connect_to_server arg=PLEXDEV
[10.822] debug3: connect_to_server arg=sftp
OpenSSH_5.0p1, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /etc/ssh/ssh_config

debug1: Reading configuration data /etc/ssh/zos_ssh_config

debug3: RNG is ready, skipping seeding

debug1: zsshSmfSetConnSmfStatus: SMF status is 0

debug1: Rhosts Authentication disabled, originating port will not be trusted.

debug2: ssh_connect: needpriv 0

debug1: Connecting to PLEXDEV [156.36.137.9] port 2222.

debug1: Connection established.

debug1: cipher_init: none from source OpenSSL

debug1: cipher_init: none from source OpenSSL

debug3: zsshGetpw: passwd name=WTBOURG, uid=30000411, gid=1, dir=/, shell=/bin/sh

debug1: identity file /.ssh/id_rsa type -1

debug1: identity file /.ssh/id_dsa type -1

debug1: Remote protocol version 2.0, remote software version OpenSSH_5.0

debug1: match: OpenSSH_5.0 pat OpenSSH*

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_5.0

debug2: fd 3 setting O_NONBLOCK

debug3: RNG is ready, skipping seeding

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1
4-sha1,diffie-hellman-group1-sha1

debug2: kex_parse_kexinit: ssh-rsa,ssh-dss

debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast1
28-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se

debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast1
28-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se

debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96
,hmac-md5-96

debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96
,hmac-md5-96

debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib

debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib

debug2: kex_parse_kexinit:

debug2: kex_parse_kexinit:

debug2: kex_parse_kexinit: first_kex_follows 0

debug2: kex_parse_kexinit: reserved 0

debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1
4-sha1,diffie-hellman-group1-sha1

debug2: kex_parse_kexinit: ssh-rsa

debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast1
28-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se

debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast1
28-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se

debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96
,hmac-md5-96

debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96
,hmac-md5-96

debug2: kex_parse_kexinit: none

debug2: kex_parse_kexinit: none

debug2: kex_parse_kexinit:

debug2: kex_parse_kexinit:

debug2: kex_parse_kexinit: first_kex_follows 0

debug2: kex_parse_kexinit: reserved 0

debug1: mac_setup_by_id: hmac-md5 from source OpenSSL

debug2: mac_setup: found hmac-md5

debug1: kex: server->client aes128-ctr hmac-md5 none

debug1: mac_setup_by_id: hmac-md5 from source OpenSSL

debug2: mac_setup: found hmac-md5

debug1: kex: client->server aes128-ctr hmac-md5 none

debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP

debug2: dh_gen_key: priv key bits set: 121/256

debug2: bits set: 520/1024

debug1: SSH2_MSG_KEX_DH_GEX_INIT sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY

debug3: put_host_port: [156.36.137.9]:2222

debug3: put_host_port: [plexdev]:2222

debug3: check_host_in_hostfile: filename /FIRSTAR/etc/coz/known_hosts

debug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hosts

debug3: check_host_in_hostfile: filename /FIRSTAR/etc/coz/known_hosts

debug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hosts

debug1: checking without port identifier

debug3: check_host_in_hostfile: filename /FIRSTAR/etc/coz/known_hosts

debug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hosts

debug3: check_host_in_hostfile: filename /FIRSTAR/etc/coz/known_hosts

debug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hosts

debug3: check_host_in_hostfile: filename /FIRSTAR/etc/coz/known_hosts

debug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hosts

debug2: no key of type 0 for host [plexdev]:2222

debug3: check_host_in_hostfile: filename /.ssh/known_hosts2

debug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hosts2

debug3: check_host_in_hostfile: filename /FIRSTAR/etc/coz/known_hosts

debug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hosts

debug2: no key of type 2 for host [plexdev]:2222

debug1: read_passphrase: can't open /dev/tty: EDC5128I No such device. (errno2=0x056201A9)

debug1: permanently_drop_suid: 30000411

fromdsn(WTBOURG.PASSWD(SITE1))[N]: 1 records/80 bytes read; 9 bytes written in 0 milliseconds.
debug1: read_passphrase: can't open /dev/tty: EDC5128I No such device. (errno2=0x056201A9)

debug1: permanently_drop_suid: 30000411

fromdsn(WTBOURG.PASSWD(SITE1))[N]: 1 records/80 bytes read; 9 bytes written in 0 milliseconds.
debug1: read_passphrase: can't open /dev/tty: EDC5128I No such device. (errno2=0x056201A9)

debug1: permanently_drop_suid: 30000411

fromdsn(WTBOURG.PASSWD(SITE1))[N]: 1 records/80 bytes read; 9 bytes written in 0 milliseconds.
debug1: read_passphrase: can't open /dev/tty: EDC5128I No such device. (errno2=0x056201A9)

debug1: permanently_drop_suid: 30000411

fromdsn(WTBOURG.PASSWD(SITE1))[N]: 1 records/80 bytes read; 9 bytes written in 0 milliseconds.
debug1: read_passphrase: can't open /dev/tty: EDC5128I No such device. (errno2=0x056201A9)

debug1: permanently_drop_suid: 30000411

fromdsn(WTBOURG.PASSWD(SITE1))[N]: 1 records/80 bytes read; 9 bytes written in 0 milliseconds.
debug1: read_passphrase: can't open /dev/tty: EDC5128I No such device. (errno2=0x056201A9)

debug1: permanently_drop_suid: 30000411

fromdsn(WTBOURG.PASSWD(SITE1))[N]: 1 records/80 bytes read; 9 bytes written in 0.001 seconds (8.789 KBytes/sec).
debug1: read_passphrase: can't open /dev/tty: EDC5128I No such device. (errno2=0x056201A9)

debug1: permanently_drop_suid: 30000411

fromdsn(WTBOURG.PASSWD(SITE1))[N]: 1 records/80 bytes read; 9 bytes written in 0 milliseconds.
debug1: read_passphrase: can't open /dev/tty: EDC5128I No such device. (errno2=0x056201A9)

debug1: permanently_drop_suid: 30000411

fromdsn(WTBOURG.PASSWD(SITE1))[N]: 1 records/80 bytes read; 9 bytes written in 0 milliseconds.
debug1: read_passphra



//SFTPGET EXEC PROC=SFTPPROC
//SFTPIN DD *
sftp_opts="-vvv"
pwdsn="WTBOURG.PASSWD(SITE1)"
user=WTBOURG
port=2222
host=PLEXDEV
lzopts="MODE=TEXT,L=NL"
lfile=//DD:MYDD
rfile=/DEV1/tmp/cjpete8/test/testfile

. $script_dir/sftp_get.sh

//MYDD DD DSN=WTBOURG.COZ.TEST,DISP=(NEW,KEEP),
// DCB=(LRECL=80,RECFM=FB),SPACE=(CYL,(3,1)),
// STORCLAS=NGSBASE
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: can't open /dev/tty: EDC5128I No such device.

Post by dovetail »

I believe that the problem is that the IBM Ported Tools OpenSSH client is looping trying to prompt "the user" to accept a new host key.
The debug message "can't open /dev/tty ..." is normal, but you should only get it once.

This message indicates that a public key for the host was know found in known_hosts:

debug2: no key of type 2 for host [plexdev]:2222

Since you have SSH_ASKPASS set (to use read_passwd_dsn.sh to read your password), this is actually being called to prompt "Y or N" to accept the host key for the first time. It should really not be doing this, which is caused by a missing ssh option.

You seem to be using the sample CO:Z SFTP proc and scripts (which is recommended), but the defaults (member SFTPIND) that we ship ends with these lines:

#
# Set the following option to "no" if you would like to
# automatically accept host keys for new servers.
sftp_opts="$sftp_opts -oStrictHostKeyChecking=yes"

You seem to have deleted the last line.
You need to set StrictHostKeyChecking to either yes or no.

The default option is "ask", which is what is causing the loop.

BTW: in the current release, the "read_passwd_dsn.sh" script will print out the prompt line that it is given, which helps to make this problem more obvious.
wtbourg
Posts: 3
Joined: Thu Aug 08, 2013 9:11 am

Re: can't open /dev/tty: EDC5128I No such device.

Post by wtbourg »

Thank you for the reply.

This is the proc and the SFTPIND that was used and it has sftp_opts="$sftp_opts -oStrictHostKeyChecking=no"

//SFTPPROC PROC ARGS='-LD',
// LIBRARY='SYS1.COZ.LOADLIB',
// SFTPIND='SYS1.COZ.SAMPJCL(SFTPIND)',
// REGSIZE='64M',
// LEPARM=''
//RUNSFTP EXEC PGM=COZBATCH,REGION=&REGSIZE,
// PARM='&LEPARM/&ARGS'
//STEPLIB DD DSN=&LIBRARY,DISP=SHR
//STDIN DD DSN=&SFTPIND,DISP=SHR
// DD DDNAME=SFTPIN
//SFTPIN DD DUMMY < Customized stdin to SFTP
//*
// PEND


VIEW SYS1.COZ.SAMPJCL(SFTPIND) - 01.00 Columns 00001 0008
Command ===> Scroll ===> CSR
000024 # SFTP OPTIONS VARIABLE:
000025 #
000026 # sftp_opts - May be set to any site specific SFTP options, including any ssh
000027 # options (designated via the -o switch).
000028 #
000029 sftp_opts=""
000030 sftp_opts="$sftp_opts -oConnectTimeout=60"
000031 sftp_opts="$sftp_opts -oServerAliveInterval=60"
000032 #
000033 # Set the following option to "no" if you would like to
000034 # automatically accept host keys for new servers.
000035 # sftp_opts="$sftp_opts -oStrictHostKeyChecking=yes"
000036 sftp_opts="$sftp_opts -oStrictHostKeyChecking=no"
000037
****** ******************************** Bottom of Data ******************************
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: can't open /dev/tty: EDC5128I No such device.

Post by dovetail »

If you look at your debug output, you can see that the options from SFTPIND are missing.
I see the issue now.

Your line:

sftp_opts="-vvv"

is replacing all of the other options.

It should be:

sftp_opts="$sftp_opts -vvv"
wtbourg
Posts: 3
Joined: Thu Aug 08, 2013 9:11 am

Re: can't open /dev/tty: EDC5128I No such device.

Post by wtbourg »

Thank you!!

Changing from
sftp_opts="-vvv"

To

sftp_opts="$sftp_opts -vvv"

Corrected the issue.
Post Reply