How to check the remote file whether it exists?
Check the remote file whether it exists ssh -q ubuntu@10.10.10.10 [[ -f /etc/nginx/conf.d/test.conf ]] && echo “true” || echo “false”
Check the remote file whether it exists ssh -q ubuntu@10.10.10.10 [[ -f /etc/nginx/conf.d/test.conf ]] && echo “true” || echo “false”
$ ssh -f -N -v -t -L 5433:target_host:5432 user@jump_server target_host is the host/database_server/RDS that you want to access that only can be accessed from jump _server or bastion if you’re using AWS jump_server is the host that accessible from you and the only host that can access target_host 5432 is local port (postgresql default) 5433 is the … Read more
This is a quick guide will show you how to open ssh tunnel to ssh into your target server that can only be accessed from jump server. So this is how to do it: ssh -v -t -L 10443:localhost:20443 <jump_server> ssh -t -L 20443:localhost:443 user@<target_server> jump_server is the host that accessible from you and the … Read more
To connect host with specific key $ ssh user@host -i mykey.pem
Simple tunneling with ssh with port forwarded to connect your service locally. Make sure your local port is available first. $ ssh -f user@website.com -L 2000:website.com:5432 -N