Article 6KGV2 bash script to work on server

bash script to work on server

by
sag2662
from LinuxQuestions.org on (#6KGV2)
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 0Can anyone suggest me what is missing

Code:#!/bin/bash
# SSH connection and command execution
sshpass -f pass_file ssh -NT -o StrictHostKeyChecking=no username@ip <<EOF
enable
config
exit
EOF
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments