-1

I want to run multiple commands with same shell.

Executing command of paramiko library is not with same shell.

Commands :

Ssh cloud-user@node -i /path/to/bcmt_rsa
Cat /etc/ssh/sshd_config
Change permitRootLogin yes to no
Restart sshd server
Log to file. 

I am new in python. I have tried many ways but not working

Random Davis
  • 6,662
  • 4
  • 14
  • 24

2 Answers2

0

Not clear questing but i have example lets say you want to edit file then read it have variable

command="echo data >> path_to_file/filename.txt" command+="cat path_to_file/filename.txt"

then execute ssh normal and read the stdout lines ,or you can use && in the command like command="echo data >file_path.txt && cat file_path.txt"

0

Do you want to runultiple comand at a time in single sell?I think its not possible.But you can splot your terminal and can run differend comand in didferent partifion of a terminal.For this you can use Terminator,a great bash terminal.

Besides python is a single threded language.So you can not run multiple function same time in a script.Python will exicute function by function

Sonet Adhikary
  • 466
  • 1
  • 4
  • 8