Trying to access remote jupyter notebook via ssh tunnel - ssh

I need some help accessing a remote jupyter notebook instance
normally, when I am trying to access a jupyter notebook running on a remote server on my mac, I will write the following in a terminal window to create the tunnel
ssh -NL $local_port_number:localhost:$remote_port_number $my_username#$remote_server
afterwards, I can usually access the jupyter server at http://localhost:local_port_number
how do I do this in putty on windows? I know there is some option in connection>>ssh>>tunnels to do this, but I cannot get the configuration to work so far.

In remote host, open the terminal, change directory to where you have your notebooks and type:
jupyter notebook --no-browser --port=8889
# you should leave the this open
In your local computer, open MS-DOS cmd (if using Windows) or Unix terminal, then type:
ssh -N -f -L localhost:8888:localhost:8889 username#your_remote_host_name
# make sure to change `username` to your real username in remote host
# change `your_remote_host_name` to your address of your working station
# Example: ssh -N -f -L localhost:8888:localhost:8889 laura#cs.rutgers.edu
Now open web browser (google chrome, firefox, ...) and type:
localhost:8888
# you will see your notebooks in your given directory
From:
http://amber-md.github.io/pytraj/latest/tutorials/remote_jupyter_notebook

To access Jupyter over the SSH tunnel on Windows you will need to 1) initiate the tunnel in Putty and 2) configure your web browser to send traffic over the tunnel.
To Initiate the tunnel in Putty:
1) Navigate to Connection-->SSH-->Tunnels
2) Put in the local address for which you want to forward traffic
3) Click the 'Dynamic' radio button
4) Click the 'Add' button
5) Click the 'Open' button to initiate the connection
For Chrome and Internet Explorer
1) Use the Start->Run menu to run inetcpl.cpl
2) In the 'Connections' tab click 'LAN Settings'
3) Click on the 'Use a proxy server for your LAN' check box
4) Click 'Advanced'
5) In the 'Socks' field type '127.0.0.1' and add the port that you chose above
6) Apply these changes by clicking the 'Ok' button
You should now be able to access Jupyter over the SSH tunnel.

Related

How to open Apache Airflow, using SSH in Putty in web, when port 8080 is already taken by Postgres?

I have a cluster running on Google Cloud. I have an active connection to master, using Putty SSH (I have used public and private keys generated by PuTTy Key Generator), so I am logged in as a user and I have a password. At the same time, I have Apache Airflow server running in master (I run it by using SSH in Google Cloud).
I want to see graphical interface and graph flow at port 8080. However, it is already taken.
enter image description here
enter image description here
I have typed in cmd the following command: netstat -a -n -o | find "8080"
The result is like that:
enter image description here
I've tried stopping what is running on this port but I can't do it.
What should I type in "Source port" and "Destination" in Putty SSH Tunnels configuration to open Apache Airflow?

Can't connect to port 22, Connection timed out

I just recently got into whatever you might call this stuff. I was just trying to send a java file over to the computer I ssh to. But when I went to do it, I just get told
sh: connect to host port 22: Connection timed out
lost connection
If possible I would like it explained very simply because of how new I am to this kind of stuff.
SSH to remote host(VM Ubuntu) from VS code terminal
Install VS Code with Remote Development extension pack.
Install Virtual machine (Virtual box) and Ubuntu running on it.
Check Ubuntu-Network-Settings-IPv4 address (10.0.2.15-default for VM).
Go to your virtual box Settings-Network-NAT Adapter (double-check).
Go to your virtual box Settings-Network-In Advanced-Port Forwarding.
Add this as given below and click ok and hereafter consider 127.0.1.1 for ssh.
portforwardinginVM
View the status and disable firewall settings in Ubuntu VM (ufw command).
In VS Code, View-Command Palette- Add new SSH host .
Add ssh username#127.0.1.1 and enter.
Or go to the terminal window (eg. Powershell) and type ssh username#127.0.1.1, it will ask if you want to update to host lists permanently, asking like yes/no and also your Ubuntu password to confirm.
Now try to connect to the host using username#127.0.1.1 and selecting OS like Ubuntu, then type the Ubuntu password.
That's it you are logged in to your virtual machine and can access files now from your local machine.

SSH connection to jupyter notebook opens but browser unable to connect

I have a bizarre problem with my SSH connection. I am trying to connect to Ubuntu server from Windows client (local network, Bitvise SSH client).
jupyter notebook --no-browser --port=8885
Everything launches as normal. I then go to my client
ssh -p 2222 -N -f -L 8800:localhost:8885 user#server
Everything seems normal and I get in. I then go my browser and try localhost:8800 and localhost:8885. Neither responds. Any tips would be appreciated. Many thanks.

How to connect to codeanywhere ide by secure shell?

I installed the Secure Shell extension for chrome on windows. Can anyone please tell me how to connect to my devbox in codeanywhere using this secure shell extension?
Thanks for all the help
In order to use Chrome Secure Shell to connect to your CodeAnywhere container, you will need:
The hostname and port for your container. (You can find that by right-clicking your container, choosing Info, and looking for the SSH access information.)
The username will be cabox. [1]
You will also need both a private and a public key in order to import an identity into Chrome Secure Shell. [2]
Your container's private key is stored in /home/cabox/.ssh/id_rsa and the public key is stored in /home/cabox/.ssh/id_rsa.pub
Since the /home/cabox/.ssh/ folder is not visible in the left-hand menu, open an SSH terminal to your container. (Right-click your container, then choose SSH Terminal.)
At the prompt, type cp ../.ssh/id_rsa . to copy the private key to the workspace folder.
At the prompt, type cp ../.ssh/id_rsa.pub . to copy the public key to the workspace folder.
Right-click your container, and click Refresh to refresh the list of files
Download the id_rsa and id_rsa.pub files (which should now be visible on the left-hand menu) by right-clicking and choosing Download
In Chrome Secure Shell,
Give the connection a name
Use the username cabox
Fill out the hostname and port
Next to Identity, click Import. When file selection screen opens, choose both the id_rsa and the id_rsa.pub files
Once the Identity has been imported, you should be able to connect to your CodeAnywhere container.
Well, I have no idea about ssh extension on chrome, but firstly you have to install a ssh server on your devbox. If your devbox is ubuntu you should try like this from your codeanywhere ssh terminal:
sudo apt-get install openssh-server
After that check your ip on your devbox machine by:
ifconfig
command. Finnaly connect to your devbox from your chrome extension ssh by:
ssh yourUsernameFromDevbox#devboxIP
After that you just insert your devbox machine password and voila.

Connect ipython-notebook via SSH tunnel from a remote location

I'm trying to open an ipython-notebook (which is running on a server) on a macbook from a remote location through an ssh tunnel but no data received.
This is the command for the SSH tunnel
ssh -L 5558:localhost:5558 -N -t -x user#remote-host
and this is the command I used to lunch the notebook form the server
ipython notebook --pylab=inline --port=5558 --ip=* --no-browser --notebook-dir notebooks
Than I tried to open it on a new tab with this remote-host:5558 but no data received.
Thanks in advance!
The directive -L AAAA:somehost:BBBB will cause SSH to listen on port AAAA on localhost (the machine the ssh command is run on) and forward any connection to that port, over the SSH session, to the host somehost port BBBB. So, you need to open http://localhost:5558/ in the browser on the machine you run the ssh command on.
Read this: How do I add a kernel on a remote machine in IPython (Jupyter) Notebook?
Remote jupyter kernel/kernels administration utility (the rk) here: https://github.com/korniichuk/rk