Friday, February 1, 2013

SSH Login Prowl Notifications Linux

SSH Prowl Notifications Linux.

Get notifications for events on your IPhone is a nice thing.
You can get notifications for every event that you like.

Here is a small HowTo for Prowl notifications for SSH Logins on your Linux box.

Short Version
  1. Get a Prowl account and API Key: https://www.prowlapp.com
  2. Install the IPhone app.
  3. Download the Prowl Script: https://prowl.weks.net/static/prowl.pl
  4. Edit your /etc/bashrc file

Step by Step

Register at https://www.prowlapp.com/register.php
Generate your API Key at https://www.prowlapp.com/api_settings.php

Download the Prowl Perl Script at https://prowl.weks.net/static/prowl.pl
I have placed it at "/usr/bin/" and "chmod 755" on "/usr/bin/prowl.pl"

Install the Prowl APP on your IPhone. And Login with your new account.

I had to install on my Centos 6.3
perl-WWW-Curl
openssl-perl
perl-Crypt-SSLeay

To get this Script running.


To Enable SSH Login Notifications for every login.
edit
"/etc/bashrc"
and add at the bottom
/usr/bin/prowl.pl -apikey="YOUR API KEY" -application="prowl.pl" -event="Notification" -notification="SSH Login @Home User: `id`"

Send a Test Notification:
/usr/bin/prowl.pl -apikey="YOUR API KEY" -application="prowl.pl" -event="Notification" -notification="SSH Login @Home User: `id`"

Just Replace the "SSH Login @Home User: `id`" with your notifications...

Thats it.

If you Like you can enable a log

touch /var/log/prowl.log
chmod 755  /var/log/prowl.log
vi /etc/bashrc and add above your prowl script line

echo "###" >>/var/log/prowl.log
echo "`date`" >>/var/log/prowl.log
echo "SSH Login" >>/var/log/prowl.log
echo "`id`" >>/var/log/prowl.log
/usr/bin/prowl.pl -apikey="YOUR API KEY" -application="prowl.pl" -event="Notification" -notification="SSH Login @Home User: `id`"2>&1 >>/var/log/prowl.log









Wednesday, January 23, 2013

Live System Rescue Environments. CD / USB Stick


Live Rescue CD / USB Stick.

We all know the Situation...
You reboot a system and surprise its not booting anymore.
Or you get a call from someone and he is asking for your help.
Maybe its an HDD Failure or a Virus or Just to reset a Windows Password.

There are some great projects that focus on System Rescue Environments.
And its always nice to have a USB Stick with all your tools to save the day :)

2 good rescue environments i use...
You can boot them from CD or USB..

even create a multi boot USB Stick with both of them and bunch of Linux Distros


Multi boot USB creator
http://www.pendrivelinux.com/
i used http://www.pendrivelinux.com/yumi-multib...b-creator/



Trinity Rescue Kit or TRK
http://trinityhome.org

Trinity Rescue Kit or TRK is a free live Linux distribution that aims specifically at recovery and repair operations on Windows machines, but is equally usable for Linux recovery issues. Since version 3.4 it has an easy to use scrollable text menu that allows anyone who masters a keyboard and some English to perform maintenance and repair on a computer, ranging from password resetting over disk cleanup to virus scanning





SystemRescueCd
http://www.sysresccd.org/SystemRescueCd_Homepage

Description: SystemRescueCd is a Linux system rescue disk available as a bootable CD-ROM or USB stick for administrating or repairing your system and data after a crash. It aims to provide an easy way to carry out admin tasks on your computer, such as creating and editing the hard disk partitions. It comes with a lot of linux software such as system tools (parted, partimage, fstools, ...) and basic tools (editors, midnight commander, network tools). It can be used for both Linux and windows computers, and on desktops as well as servers. This rescue system requires no installation as it can be booted from a CD/DVD drive or USB stick, but it can be installed on the hard disk if you wish. The kernel supports all important file systems (ext2/ext3/ext4, reiserfs, btrfs, xfs, jfs, vfat, ntfs), as well as network filesystems (samba and nfs).