We can use SSH default configuration file to create SSH alias. To do so, edit ~/.ssh/config file (If this file doesn’t exist, just create one):
$ vi ~/.ssh/config
Add all of your remote hosts details like below:
Host webserver
HostName 192.168.225.22
User sk
Host dns
HostName server.example.com
User root
Host dhcp
HostName 192.168.225.25
User ostechnix
Port 2233
ssh zach@52.70.247.48
ssh zach@localhost -p 11231 `@LiG|\|@zach`
nessus tunnel:
login as steven, sudo to root, add ssh key to ~/.ssh/authroized_keys
ssh -N -J zach@52.70.247.48 -L6969:127.0.0.1:8834 zach@localhost -p11011
**Dynamic Forward
ssh -N -D localhost:10000 -J zach@52.70.247.48 zach@localhost -p 11011**
tx procdump to spike
scp -J zach@52.70.247.48 -P 11231 procdump.exe root@localhost:/root/tools/impacket/examples/
tx from spike to local machine
scp -J zach@52.70.247.48 -P 11231 root@localhost:/root/tools/impacket/examples/lsass.DMP
ssh -J zach.lawson@concentrator.whiteoaksecurity.rocks whiteoak@localhost -p 9006 -L 8834:0.0.0.0:8834 -D 7070
# setup proxy
proxy --host 0.0.0.0 --port (port number)
# ssh with reverse flag
ssh root@server -R (port):0.0.0.0:(port)
ssh-keygen
enter in the info needed (location/name)
Once key is created use:
ssh-copy-id -i ~/.ssh/mykey user@host
if you get the error:
Unable to negotiate with 123.123.123.123 port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
Use the -oKexAlgorithms
or -keyexchange
Example:
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 user@legacyhost root@10.0.0.1