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 user@999.99.99.999 
jupyter notebook --port 9999

When I run the script I get connected to the server using ssh dave@999.99.99.999command 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

2

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

ssh user@999.99.99.999 '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'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.