How do ensure that server in droplet does not stop once I discconnect SSH connection from my local machine? - ssh

I have created a droplet in digital ocean ( I guess OD calls Virtual Machines - Droplets) that hosts a server. Droplet has Ubuntu as OS. For setting up the server in the droplet, I have accessed the droplet console through SSH public key from a local ubuntu machine. The server is spun successfully. However, closing the SSH connection kills all live sessions of the server. How Do I ensure that server continues to spin even after I kill the SSH connection?
I have tried accessing from cli - ssh - route and console provided by digitalocean for the virtual machine. Both resulted in stoppage of server when connection with droplet of closed. I guess I need ensure that the command to spin the server is system wide command not just the ssh session. How do I do that ?

Related

Connect to Redis on WSL Windows 10 from remote client

I've a Redis instance running on a Windows 10 Machine and connecting to Redis locally works perfectly.
When i try to reach Redis from a remote client in the network it doesn't seem to work.
The
Windows machine has the ip 172.22.23.112
Ubuntu WSL 172.22.160.1.
The Firewall for Windows is down, the Port 6379 is enabled on Ubuntu, firewall is down there too.
in redis.conf
bind 127.0.0.1 172.22.23.51 172.22.23.55
protected-mode no
i thought when i connect to the windows machine with a redis client and the appropriate port, windows will forward this request to the WSL Redis Server?
Since i get a timeout i guess i'm doing something wrong!
i set bind to 0.0.0.0
and issued the following command in windows
netsh interface portproxy add v4tov4 listenport=6379 listenaddress=0.0.0.0 connectport=6379 connectaddress=172.x.x.x
where connectaddress is the WSL ip address
connection works, now i've to ensure
the wsl ip address is static
the command is issued everytime the computer starts
other than that it works

Connect host ldap server to local VM

I have a server installed on VM and a LDAP(opendj) server created using Apache Directory Studio on my host computer. Now, I would like to connect that LDAP server to local VM so that the VM server can pull user's information from LDAP server. is it possible to do that? I could not understand how to establish a communication between these two server.
Thanks.
Remote Port Forwarding actually does work here.
my ldap server port was 10389.
I have created a tunnel from host to vm:
ssh -R 10389:localhost:10389 root#172.16.130.132(vm-ip)
after then, vm can reach to the host through this port (10389).
Sorry, I don't have that much knowledge on ssh. But this one worked for me.

Port forwarding EMR Zepplin through SSH

I'm trying to establish a secure connection to my emr server on AWS.
I have successfully connected through putty to it. However I would like to use zeppelin through the SSH tunnel.
Does the following look correct to forward the port 8890 from the EMR host to my local machines 8890 so that traffic is encrypted? Im on a windows machine.
Thanks,
Tim
Destination is in respect to the SSH Server. Providing Localhost:8890 will mean 8890 of the machine on which SSH server is running.

What's the best way to reverse ssh tunnel to access system behind corp firewall?

I am trying to access a linux server through ssh. Typically this is accessed through a Win2012 jump server using putty.
I was able to setup a reverse ssh connection in putty from jump server to a AWS VM through HTTP proxy. And this was supposed to forward it to my linux server. But when I connect to my AWS VM and initiate ssh over my remote port, the whole thing just hangs. What am I doing wrong, and is there a better/easier way? No malicious intent, I have physical access to both jump server and linux server. Just bypassing shitty corp firewall.
Can you explain what you did in details ?
Typically on unix systems, for a reverse ssh tunnel, you can do this on your server behind the firewall:
ssh -NR ssh_port_AWS:localhost:ssh_port_local_server user#ip_AWS
You need to replace
ssh_port_AWS by the port of the distant server that you want to use to access the local server.
ssh_port_local_server by the port of the ssh server of your local server (if you don't change anything, 22).
user#ip_AWS by your AWS connection details (user#IP)

Setting up a CNAME / Nickname for a remote server

Let's say I have a digital ocean droplet - 68.456.72.184
When ssh-ing into my remote server, I'd rather not have to type out the whole ssh command -
ssh 68.456.72.184
The host's name is Stormtrooper - how do I make it so that client machines can ssh into the server via
ssh Stormtrooper
I imagine this requires some sort of configuration on the local client machine that's connecting? In what order does does a client machine search for host names? I imagine there's some local setting where it looks for "Stormtrooper"'s IP address, and if not found it it looks in the local network, and then looks in the "global" network (i.e. public DNS).
I'm not quite sure how that lookup process works, so an explanation there would be great as well.
You can create local ssh_config in ~/.ssh/config with a content:
Host Stormtrooper
Hostname 68.456.72.184
And then you can ssh to that server using ssh Stormtrooper (even tab completion will work for you).
Connecting using FQDN will work too if you have correctly set up DNS. If you have a domain Stormtrooper.tld pointing to this IP, you are able to ssh using
ssh Stormtrooper.tld
For local network resolving, you would need local DNS, which would do this translation for you.