'SSH tectia, how to run batch commands?

I have tectia ssh server in a windows environment. When I use sftpg3 -B cmd.txt username@host that works fine. The only problem is that it doesnt let me execute files remotely, it only lets me move files. It reads the commands from cmd.txt but since I cant execute anything it ignores the commands.

Well when I do the same thing but use sshg3, it doesnt recognize the -B flag at all.

SSHG3 -B cmd.txt username@host

cmd.txt' is not recognized as an internal or external command, operable program or batch file.

I've tried putting -B "cmd.txt"

I tried just putting the cmd.txt contents in the same script instead of housing them in cmd.txt and getting rid of -B, but it doesnt run them that way either.

The docs dont have much to go off of. All it says is use -B for batch processing.

Contents of cmd.txt:

D: cd Library cd Backup parseLibrary.cmd exit

Trying to sshg3 into a host, navigate to a path and run a batch file on that host. Any ideas?

 

-B, --batch-mode Uses batch mode. Fails authentication if it requires user interaction on the terminal.

Using batch mode requires that you have previously saved the server host key on the client and set up a non-interactive method for user authentication (for example, host-based authentication or public-key authentication without a passphrase).

It does use public key authentication, there is no user interaction needed on the terminal.

Noticed this on the docs for sftpg3

 

-B [ - | batch_file ]

The -B - option enables reading from the standard input. This option is useful when you want to launch processes with sftpg3 and redirect the stdin pipes.

By defining the name of a batch_file as an attribute, you can execute SFTP commands from the given file in batch mode. The file can contain any allowed SFTP commands. For a description of the commands, see the section called “Commands”.

Using batch mode requires that you have previously saved the server host key on the client and set up a non-interactive method for user authentication (for example, host-based authentication or public-key authentication without a passphrase).

 

I'm guessing batch file is different than batch mode?

*I figured it out. You have to use the -B flag for every command you want to execute.



Solution 1:[1]

I figured it out. You have to use the -B flag for every command you want to execute. sshg3 user@host -B dir -B ipconfig -B etc.cmd

Solution 2:[2]

You can use this following code for showing that style on the table:

<!DOCTYPE html>
<html>
<head>
 <style>
   table,th,td {
      border: 1px solid black;
      border-collapse:collapse;
    }
 </style>
</head>
<body>
<table width="600">
 <caption>Student's Info</caption>
  <tr>
    <th rowspan="2" width="20%">Name</th>
   <th rowspan="2" width="20%">Class</th>
   <th colspan="2" width="30%">Parents</th>
   <th rowspan="2" width="30%">Roll No.</th>
   </tr>
  <tr>
    <th>Father</th>
    <th>Mother</th>
  </tr>
  <tr>
    <td>A</td>
    <td>10</td>
    <td colspan="2">X and Y</td>
    <td>1</td>
  </tr>
  <tr>
    <td>B</td>
    <td>10</td>
    <td colspan="2">F and G</td>
    <td>2</td>
  </tr>
 </table>

</body>
</html>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 BetaTester99
Solution 2 user146847