1

I want to create a bash script that would connect to a server and run jupyter notebook on that server.

How do I run jupyter notebook command while I am connected to the server using bash script?

I use this script:

#!/bin/bash
ssh [email protected] 
jupyter notebook --port 9999

When I run the script I get connected to the server using ssh [email protected]command but the jupyter notebook --port 9999 command runs only after I manually close the connection to server.

How do I run jupyter notebook --port 9999 after I am connected to the server?

Thanks

1 Answer 1

2

You should just write command you want to run on the remote server as follows :

ssh [email protected] 'jupyter notebook --port 9999'

You can use the following formats to run command using ssh on remote server

ssh user1@server1 command1
ssh user1@server1 'command2'
ssh user1@server1 'command1 | command2'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .