bash script to work on server
Hi all,
I am trying to interact with the Terminal server via bash. I wrote a small script to be executed on terminal server, but i have the below error. If I remove EOF, then it atleast the ssh connection estlablished, but doesnot run any commands (enable,config)after that Code:
shell request failed on channel 0 Code:
#!/bin/bash |
I would do it with keys instead.
Code:
#!/bin/sh If the two programs on the server, config and enbale, are interactive, then you will need -t instead of -T and -N there. |
you might try also something like this:
Code:
cat script | ssh -i ..... |
Quote:
Code:
cat script | ssh -T -i ..... |
Quote:
|
Quote:
shell request failed on channel 0 |
Quote:
But if you are connecting to multiple remote servers: Then you can make a bunch of keys and give them predictable names so that they can be globbed: Code:
for key in ${HOME}/.ssh/server_*_ed25519; do |
If the two programs on the server, config and enable, are interactive, then you will need -t instead of -T and -N there.
|
Quote:
I have exec request failed on channel 0 |
Quote:
Code:
cat test | ssh username@ip 'cat > test' |
Has the "Terminal server" got some documentation?
|
yes, it is most probably a server side issue, need to check the configuration. And the server side logs. Probably you need to start sshd in debug mode.
|
Quote:
Code:
|
Just being curious. With a prompt like ">" and commands like enable or config it does not appear you are logging into a linux server but some type of managed device like a Cisco switch or router which runs its own embedded firmware. Since there isn't a shell it isn't possible to run commands as desired.
|
Quote:
Code:
( |
All times are GMT -5. The time now is 12:05 PM. |