Input/output error problem when using pppd with ssh and pty-redir

Input/output error problem when using pppd with ssh and pty-redir

Post by Alexander Marquard » Thu, 22 Nov 2001 05:11:55



Hello

I tried to follow the VPN-HOWTO instructions to set up a secured VPN with
ssh.
The ssh authentication works well and the server correctly starts the pppd.

My problem occurs on the client side. The HOWTO lists a little script to
connect to the
server using pty_redir, ssh, sleep and pppd as follows
====================================================================
/usr/sbin/pty_redir /usr/bin/ssh -t -e none -c blowfish -i path/to/my/key -l
username my.vpn.server >/tmp/vpn-device
sleep 10
/usr/sbin/pppd `cat /tmp/vpn-device`
====================================================================

The file /tmp/vpn-device normally contains "/dev/ptyp0" in my case.
Heres the dump when i start this script. I added some debugging switches
for better reading

====================================================================
+ /usr/sbin/pty-redir /usr/bin/ssh -t -e none -c blowfish -i
/root/.ssh/private.key -l vpn -v vpn.server.com
SSH Version 1.2.27 [i386-suse-linux], protocol version 1.5.
Standard version.  Does not use RSAREF.
localhost: Reading configuration data /etc/ssh_config
+ sleep 10
localhost: ssh_connect: getuid 0 geteuid 0 anon 0
localhost: Connecting to vpn.server.com [192.168.1.1] port 22.
localhost: Allocated local port 1023.
localhost: Connection established.
localhost: Remote protocol version 1.5, remote software version 1.2.27
localhost: Waiting for server public key.
localhost: Received server public key (768 bits) and host key (1024 bits).
localhost: Host 'vpn.server.com' is known and matches the host key.
localhost: Initializing random; seed file /home/me/.ssh/random_seed
localhost: Encryption type: blowfish
localhost: Sent encrypted session key.
localhost: Installing crc compensation attack detector.
localhost: Received encrypted confirmation.
localhost: No agent.
localhost: Trying RSA authentication with key 'vpn'
localhost: Received RSA challenge from server.
localhost: Sending response to host key RSA challenge.
localhost: Remote: RSA authentication accepted.
localhost: RSA authentication accepted by server.
localhost: Requesting pty.
localhost: Requesting shell.
localhost: Entering interactive session.
++ cat /tmp/vpn-device
+ /usr/sbin/pppd /dev/ptyp0 noipdefault ipcp-accept-local ipcp-accept-remote
noauth lock nocrtscts
Failed to open /dev/ptyp0: Input/output error
localhost:~ # Connection to vpn.server.com closed.
localhost: Transferred: stdin 0, stdout 521, stderr 40 bytes in 30.7 seconds
localhost: Bytes per second: stdin 0.0, stdout 16.9, stderr 1.3
localhost: Exit status 10
====================================================================

It seems to me that pppd cannot open the character device /dev/ptyp0
previously opened by pty_redir
to talk to the redirected ssh. (Failed to open /dev/ptyp0: Input/output
error)
After the script exited and pty_redir has released its stdin/stdout
redirection from /dev/ptyp0 there is
no problem starting "pppd /dev/ptyp0" without errors so its not a problem
of the device.

Has anyone a solution?
Please let me know!

 
 
 

Input/output error problem when using pppd with ssh and pty-redir

Post by Clifford Kit » Fri, 23 Nov 2001 10:38:00


I don't ordinarily try to answer a question on a subject that I haven't
actually tried but you don't seem to be getting much help so ...

Quote:> I tried to follow the VPN-HOWTO instructions to set up a secured
> VPN with ssh.  The ssh authentication works well and the server
> correctly starts the pppd.
> My problem occurs on the client side. The HOWTO lists a little script to
> connect to the server using pty_redir, ssh, sleep and pppd as follows
> ====================================================================
> /usr/sbin/pty_redir /usr/bin/ssh -t -e none -c blowfish -i path/to/my/key -l
> username my.vpn.server >/tmp/vpn-device
> sleep 10
> /usr/sbin/pppd `cat /tmp/vpn-device`
> ====================================================================

It's dangerous to hand copy a script.  The log shows that you did
this since pty_redir is show above while the log shows pty-redir is
actually used.  You also left out the $PPP_OPTIONS shown in the HOWTO
at the end of the cat line and verified as being used by the log.

Quote:> The file /tmp/vpn-device normally contains "/dev/ptyp0" in my case.
> Heres the dump when i start this script. I added some debugging switches
> for better reading
> ====================================================================
> + /usr/sbin/pty-redir /usr/bin/ssh -t -e none -c blowfish -i
> /root/.ssh/private.key -l vpn -v vpn.server.com

What happened to the ssh "-o Batchmode yes" option that that
HOWTO shows?  I have no idea how important that is but it is in
every example.

Quote:> SSH Version 1.2.27 [i386-suse-linux], protocol version 1.5.

[Stuff that looked okay to me omitted.]

Quote:> localhost: Entering interactive session.
> ++ cat /tmp/vpn-device
> + /usr/sbin/pppd /dev/ptyp0 noipdefault ipcp-accept-local
> ipcp-accept-remote noauth lock nocrtscts

Actually the HOWTO is dated with respect to current pppd versions.  You
should be able to use something along the lines of

$PPPD persist ppp-work:ppp-home \
      pty "$SSH -o 'BatchMode yes' -e none -C -l ppp-user \
      -i /home/ppp-user/.ssh/identity XXX.YYY.ZZZ.TTT /usr/sbin/pppd \
      notty"

for PPPD=/usr/sbin/pppd, SSH=/usr/bin/ssh, ppp-user replaced by vpn,
ppp-work:ppp-home replaced by $PPP_OPTIONS and XXX.YYY.ZZZ.TTT replaced
by vpn.server.com.  The -C probably should also be omitted.  This came
from an old post that said it worked.  If man pppd shows pty as an
option then some variant should work for you.

--

/* No matter what other nations may say about the United States,
   immigration is still the sincerest form of flattery. */

 
 
 

1. ssh/ppp vpn without pty-redir?

can anyone point to the howto for setting up a vpn with ssh and the new ppp
that doesn't need pty-redir?

Or at least explain what goes in the place of the pty-redir with the new
ppp?

Thanks!

2. Unable to handle kernel paging request?

3. pppd error - tcgetattr: Input/output error(5)

4. How can I set a date/time on dynamic pages?

5. Info about pty-redir needed

6. COPS and su....

7. Looking for pty-redir

8. getopt rearranges argv, optind doesn't care

9. pty-redir

10. pty-redir + telnet

11. pty-redir

12. pty-redir & 2.2.x

13. pppd: "Couldn't get channel number: Input/output error"