Wednesday, June 11, 2014

Checking Passwordless Login Enabled or Not

If you want to check if passwordless login enabled or not on the given host then below is the command which can be used to check for the same.

ssh -o StrictHostKeyChecking=no -o NumberOfPasswordPrompts=0 host0103 "echo hello"

We can run this in for loop for the number of hosts and it will either print error if password less login is not allowed or print the word "hello" if it is enabled. 

Friday, March 21, 2014

Extract and Repack Debian Package

I just needed to repack a Debian package to solve this problem below are the steps. 
$ mkdir -p extract/DEBIAN
$ dpkg-deb -x package.deb extract/
$ dpkg-deb -e package.deb extract/DEBIAN
[...do something, e.g. edit the control file...]
$ mkdir build
$ dpkg-deb -b extract/ build/
  • -x extracts the package contents
  • -e extracts the control files
  • -b builds the new package
Done.