JupyterLab Enginne SSH Connection - ssh

i have a JupyterLab-Engine and I want to connect the terminal via SSH to the engine.
DataSpell asks for the host, the password and the port.
For some reasons it does not work. Do you know which part of the link is the host as well as which port is meant?
The link is:
jupyter.(machinename).(universityurl)

Related

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 tunnel on a openwrt router, and access it from a LAN host

Here's the thing. I'd like to access a remote host by ssh, and make a tunnel as a proxy. I did it on my windows computer with Putty. In putty, there is a "tunnels" options, add a dynamic tunnel would do the trick. That is, a (dynamic, that is in the putty's option, I don't really know what it means)tunnel at port 1111, and then I can access the internet though socks5 proxy 127.0.0.1:1111.
But now I want to make the tunnel on my openwrt router, 192.168.1.1, and access the proxy as 192.168.1.1:1111. I want to know how. There are two major question:
1.the proper command of ctl ssh to make a tunnel just as the putty did. I googled a few, but because of the 2nd question, I never know which one is correct.
2.how can I access the tunnel on the router though 192.168.1.1:1111. As I tried before with ss_local(another proxy program), I established a socks locally but it can never be accessed by my another LAN host. Are there some firewall things to do?
Does anyone know the answers? Thank you!
This is what I did to access remotely to my AP.
I used a SSH Reverse Tunnel to a remote server. Here I dump a simple script to achieve it.
key_ssh=/root/.ssh/id_rsa
user=root
ip='YOUR_SERVER_IP'
port='THE_PORT_YOU_WANT_TO_CONNECT_THROUGH'
#connect ssh
ssh -f -N -i $key_ssh -R 0.0.0.0:$port:localhost:22 $user#$ip
And in your remote server you type:
sudo su
ssh -p THE_PORT_YOU_WANT_TO_CONNECT_THROUGH localhost
You will be asked for the root password, type it and you're in.

Create ssh tunnel for avoid firewall blocking

I have remote host/server with ssh access.
I have my computer in my work network which can connect via ssh only
in within this network.
And i can not connect via ssh to other world because of port 22
blocked by firewall.
I am trying to create ssh tunnel to forward example localhost:80 to remote_server:22.(i suppose to connect via ssh to localhost and will be forwarded to my remote server)
I tried for example without proxy
sudo ssh -L localhost:443:remote_server_ip:22 root#remote_host_name
and with proxy
https://wiki.archlinux.org/index.php/Tunneling_SSH_through_HTTP_proxies_using_HTTP_Connect
I have read a lot and checked stackoverflow but it still is not clear for me how to resolve this issue.

ssh to a qemu virtual machine guest without typing in the password

Now I want to run a script from a client machine which will ssh to a virtual machine guest on a host machine and start to run a shell command. I do not want to be prompted to input the password.
So firstly I try to do it to connect to the host. I copy the file id_rsa.pub in the .ssh folder from the client to the host's file called authorized_keys in the .ssh folder. Then when I
"ssh root#hostname"
It works fine and I do not need to input the password(note my client's account is not root).
Then I try the same thing to the virtual machine guest in the host. I copied the same file to the guest. I started the guest using qemu with option "-net user,vlan=0,hostfwd=tcp::5555-:22 " which will forward the requests to host 5555 port to guest's 22 port. Then in the client, I executed
" ssh -p 5555 root#hostname "
It fails. It shows that RSA key for the host has changed or something... Note that my guest's account is also root and I can use Putty to ssh to the guest by connecting to the 5555 port of the host. And I believe the file permission is also properly handled.
Does anyone have a clue :>
Yes, this is correct behavior.
When you get connected to the host system first time, the ssh at your client machine ask you if the machine with fingerprint bla-bla-bla really the one you are wanted to connect. You replied 'yes' and ssh at your client machine memorized the host name, IP and the fingerprint in the file ~/.ssh/known_hosts. Then during all subsequent connections it verifies that the fingerprint is not changed as a change is an indication that the authentication process requires your attention. There could be a few valid reasons of a mismatch:
you re-installed sshd at the remote host;
your host uses DHCP to get its IP and the IP got changed.
The case when you know precisely that the fingerprint should not change indicates to you an attempt to make you get into another system.
This mechanism aimed to make you sure that you are logged in to the system you are expected to log in.
In your case you first log into the system at IP a.b.c.d at port 22. Then you try to log in with the same IP a.b.c.d at port 5555. There is your VM behind this port that is having different fingerprint. So ssh complains.
The solution for your problem will be to log in to the host system and then from this remote shell session into VM. Also I would recommend you to generate another pair of public/private keys for this 'remote' connection. Thus when your private key kept at the host get compromised then your private key that is kept at your workstation remains valid.

How can I set up SSH tunneling to access a webserver behind a firewall?

How would I access a webserver behind a firewall? I'm developing an application for this webserver which is not yet open to the public.
Someone walked me through this before, so I know it can be done. However, it has been about four months and I haven't been able to do it again.
I'm using Putty to connect to the remote machine. From that machine I can open the site http://dev.server.address:83 using Firefox. However, I want to be able to open http://localhost:80 on my machine to see the same page.
I'm using the server address and port 83 for the "source port"
I'm using localhost:80 for the "destination port"
You need to enter "80" into Source port and dev.server.address:83 to Destination.
[And don't forget to click the "Add" button before you leave the configuration screen. If you don't click that, PuTTY doesn't actually create a tunnel. I fell for that gotcha quite a few times myself]
Have you tried using 127.0.0.1:80 instead of localhost:80? I don't use PuTTY, but when I use SSH on my machine, I have to specify 127.0.0.1 instead of localhost.
Do you have a webserver running on your local machine? If that is listening on port 80 http://localhost:80 wont work. Alternatively try mapping the source to a different port (12345 for eg.) and then try http://localhost:12345 in your browser.
On Linux you can also make it happen with:
$ ssh -f -R 83:localhost:80 user#dev.server.address
Provided that you have an SSH account named "user".