SSh keys can be long and unwieldy to compare. Many platforms digest them to md5 formats for non disclosure such as github. This command will give you the digested fingerprint of an ssh key in linux / Mac. nJoy 😉
Tag: SSH
Automatically passing ssh password in scripts especially to ESX where passwordless ssh is hard
First you need to install sshpass. Ubuntu/Debian: apt-get install sshpass Fedora/CentOS: yum install sshpass Arch: pacman -S sshpass Example: sshpass -p “YOUR_PASSWORD” ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM Custom port example: sshpass -p “YOUR_PASSWORD” ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM:2400 from : https://stackoverflow.com/questions/12202587/automatically-enter-ssh-password-with-script This works better for me though for sshfs: echo $mypassword | sshfs -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@host mountpoint -o workaround=rename…
Script to verify that a path is synchronized across multiple machines via ssh
This is a script I wrote for work to look through a number of remote servers via ssh (shared keys or include a .pem (id_rsa) file to compare a paths and all it’s subfolders. The result is a report of which files are out of synch and if duplicates found they are listed separately. #!/bin/bash…
Run a local script on remote machine with parameters
So you have a script on the local machine and you want to run it remotely and pass arguments to it : ssh user@remote ‘cat | bash /dev/stdin param1 param2 .. paramN’ < /usr/scripts/localscript.sh 😉 nJoy
Disabling IPv6, breaks SSH X11 Forwarding in Linux CENTOS and UBUNTU all versions
This was a weird one. It took me ages to discover why SSH X11 died at some point after tuning a box. It so happens that disabling IPv6 ( not used on my networks) is assumed in SSH at some point and if you disable it (which many people say is a way to avoid…
Using Puttygen to create a ssh key and passwordless login with putty to Centos.
The ssh password-less login works in a  simple way. Though sometime people find it confusing. The basics: >  Client side has a private key pointed to by >  Server side has the public key of the client. On your client box create a public and private key set using (for putty) puttygen. (In linux all…
Recording a session for a user when he / she logs in ssh
To start recording each session add this to the users .profile file DATE=$(date +”%Y%m%d%H%M”) mkdir /log/$DATE script -t 2>/log/$DATE/bashlogs.timing -aqf /log/$DATE/bashlogs.script to playback go to /log/<timestamp> and run scriptreplay  bashlogs.timing bashlogs.script 3 where the 3 is the speed up factor. nJoy;
Using Stunnel to Encrypt Unsecure Connections
So you’re a fully signed up ‘tin foil hatter’ and you have an old app that communicates over the internet but doesn’t use SSL? Not to worry, there is a solution for you and its called stunnel. Stunnel is available for both Linux and Windows, and simply put creates an SSL tunnel from one machine…
Screen script for multi-user session or reminding you to create a screen on logon
A common problem when many people share large systems as the same user ( I know .. I know but anyways move on ) Â is that when you logon you might want to take over where someone else left off. Also sometimes you want to share a session with someone for supervision or just team…
Starting vnc on Display 0 ( local display ) from a remote ssh session
i.e. You wnet home need your desktop have ssh no vnc !! Here is the easy solution.. Install x11vnc. $ DISPLAY=localhost:0 x11vnc & connect to the display using vnc et voila ! BTW Teamviewer also USED TO WORK but no longer in ver 8 so thanks VNC for not being obsolete.. nJoy 🙂