I’m working on a project where I have to run a python script which will open a tmux session with multiple windows, in each one ssh into a different remote machine, and run another python script. I’m new to both tmux and ssh and I was using VS Code’s built in terminal, which worked fine, up until I wanted to clear the tmux server. I manually ran tmux kill-server
to get rid of all the sessions and windows I had created. Upon running my python script again, I noticed that it hadn’t given an output like it usually did. I attached to the tmux session and I saw that when the script had tried to ssh onto the remote machine the terminal had returned:
could not open any host key
ssh_keysign: no reply
sign using hostkey ssh-ed25519 SHA256:/BRoTCDFKguzQMzgzvdPa48k3sm6k9J9WWgmc/ly39U failed
(<user>) Password:
and then prompts you for your password.
This wouldn’t be a problem if I was SSHing into the remote machine manually, but I have a python script that runs
set_up_file_command = f'tmux send-keys -t {session_name} -l "ssh {cpu_name} python {file_path} {cpu_name}"'
subprocess.run(set_up_file_command, shell=True)
I can probably change the script to accommodate a password but I’m interested in why clearing the tmux server to begin with created this issue and why a normal terminal works.
When I ssh into the remote machine through a normally opened terminal all I have to do is ssh <machine_name>
, without specifying a password.
I’ve tried restarting the integrated terminal and restarting the tmux server several times but nothing has changed. I’m very inexperienced when it comes to ssh, tmux, and server work and I’m pretty lost. I can use the regular terminal to run my python script but I just want to know why it doesn’t work in the integrated terminal?
a dude is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.