Connect to custom SSH subsystem (TACL process on HP NonStop) with Python and Paramiko

584 views Asked by At

How can I can establish direct connection to a HP NonStop TACL process, without involving any OSS functionality via Python and Paramiko?

In HP NonStop SSH manual I can see this (http://www.nonstoptools.com/manuals/FTP-SSH.pdf):

To Get a TACL Prompt Using a Remote SSH Client

You can also directly establish a connection to a TACL process, without involving any OSS functionality. Direct TACL access is provided by SSH2 as an SSH2 subsystem. You may connect to the TACL subsystem by specifying starting the remote SSH client with the –s option and "tacl" as subsystem name. Like with an ordinary shell session, you have to specify the Guardian userid and the IP address or host name, where SSH2 is listening on as parameters for the SSH command:

m.horst@np-dev02:~> ssh -s [email protected] tacl    
[email protected]'s password:    
TACL (T9205D46 - 19OCT2004), Operating System G06, Release G06.25.00    
(C)1985 Tandem (C)2004 Hewlett-Packard Development Company, L.P.    
CPU 1, process has no backup    
February 10, 2006 13:09:41    
(Invoking $SYSTEM.SYSTEM.TACLLOCL)    
(Invoking $DATA1.MHHOME.TACLCSTM)    
Current volume is $DATA1.MHHOME    
1>

My question is that how I can specify the subsystem name tacl via Paramiko?

In PuTTY it is done like this: Connections -> SSH -> Remote command -> "tacl"

Any idea how I can do the same thing in Paramiko?

1

There are 1 answers

0
Martin Prikryl On

My question is that how I can specify the subsystem name tacl via Paramiko?

ssh = paramiko.SSHClient()

# authenticate here
chan = ssh.get_transport().open_session()
chan.invoke_subsystem("tacl")
stdin = chan.makefile_stdin("wb", bufsize)
stdout = chan.makefile("r", bufsize)
stderr = chan.makefile_stderr("r", bufsize)

In PuTTY it is done like this: Connections->SSH->Remote command->tacl

No, it's not. PuTTY cannot execute custom subsystems. So, if you can work with tacl in PuTTY, it means that you do not need to use subsystems. What you do in PuTTY, is that you simply execute tacl command.

In Paramiko, that's as simple as:

(stdin, stdout, stderr) = ssh.exec_command("tacl")