Jul 072010

If you want to connect to remote machine named othermachine as user named othermachineuser.

On your local machine you need to generate a private-public keypair using ssh-keygen as follows (You only need to do this once):
ssh-keygen -t dsa

This will create a private and public keypair which is stored in ~/.ssh directory.

Next run the following command once for every machine you want to remotely login without specifying password:
scp ~/.ssh/id_dsa.pub othermachineuser@othermachine:~/.ssh/authorized_keys

Now you can login to the machine using ssh without requiring to specify any password. Your public key, which you copied to the remote machine, is checked (not directly) against your private key to verify your authenticity.

Feb 092010

EnCrypt an RDP file password

Enter the following into a batch file.

:: Usage:
:: LTD2.cmd password
:: Variables:
:: “hashtool”   – location of the hash tool
:: “outputfile” – destination and name for the .rdp file
:: “comp”       – computer name (can be FQDN or NetBIOS)
:: “domain”     – name of authenticating domain
::                  (if stand-alone enter computer name)
:: “usr”        – Username
@echo Off

If “%1″==”” Goto EOF

set pwd=%1
Set hashtool=”C:\Software\CryptRDP5\cryptRDP5.exe”
set outputfile=”%C:\Software\CryptRDP5\computerA.rdp”
set comp=thecomputername
set domain=thedomainname
set usr=theusername

for /f “tokens=*” %%a in (‘%hashtool% %pwd%’) do set pwdhash=%%a
If EXIST %outputfile% del %outputfile%
Echo screen mode id:i:2>> %outputfile%
Echo desktopwidth:i:1024>> %outputfile%
Echo desktopheight:i:768>> %outputfile%
Echo session bpp:i:24>> %outputfile%
Echo winposstr:s:0,1,32,68,800,572>> %outputfile%
Echo full address:s:%comp%>> %outputfile%
Echo compression:i:1>> %outputfile%
Echo keyboardhook:i:2>> %outputfile%
Echo audiomode:i:2>> %outputfile%
Echo redirectdrives:i:0>> %outputfile%
Echo redirectprinters:i:0>> %outputfile%
Echo redirectcomports:i:0>> %outputfile%
Echo redirectsmartcards:i:1>> %outputfile%
Echo displayconnectionbar:i:1>> %outputfile%
Echo autoreconnection enabled:i:1>> %outputfile%
Echo authentication level:i:0>> %outputfile%
Echo username:s:%usr%>> %outputfile%
Echo domain:s:%domain%>> %outputfile%
Echo alternate shell:s:>> %outputfile%
Echo shell working directory:s:>> %outputfile%
Echo password 51:b:%pwdhash%>> %outputfile%
Echo disable wallpaper:i:1>> %outputfile%
Echo disable full window drag:i:0>> %outputfile%
Echo disable menu anims:i:0>> %outputfile%
Echo disable themes:i:0>> %outputfile%
Echo disable cursor setting:i:0>> %outputfile%
Echo bitmapcachepersistenable:i:1>> %outputfile%

:EOFHope you find it useful!