hookitup
November 9th, 2012, 03:53 AM
hello folks,
so i wana see what fun scripts ppl come up with. lets have fun and post some fun useful shell scripts. post it in code wrapping and give it a name that describes what it does and possible a small description.
KEEP IN MIND this is not to discuss issues or problems with a script, lets keep it clean and have fun.
this is my fake logon script.
so basically what this script does when ran at login via terminal, is it will first say "access denied" as if you got the password wrong then ask you to retype it, but security its a fake logon , so you would enter the name that you specified and if correct it will let you in but if wrong i will kill that session with the username specified at the bottom of the sript
I edited my /etc/bash.bashrc file to run at login (vis SSH)
I edited my /etc/pam.d/login and /etc/pam.d/sshd to get rid of the junk that shows up at login
I ran touch ~/.hushlogin to get rid of the other junk at login
here is the script
#!/bin/bash
S="sleep .5"
N="~"
Name="some name"
echo "Access denied"
$S
read -s -p "`whoami`@ipaddress's password:" username
echo ""
if [ "$username" = "$Name" ];then
echo 'Success!!! You are now logged in.'
else
echo 'Sorry, Access Denied.'
echo $N
$S
echo $N
$S
echo $N
$S
echo "*~~~ip logged~~~> `who`"
echo 'Good Bye'
pkill -KILL -u username
pkill -KILL -u another username
fi
text in colors you will have to change for your system
if you mess this script up some how and it just automatically logs you out you can always CTRL+C to cancel it before it kicks you out. (i learned this the hardway :))
any questions about my script just fell free to PM me.
so i wana see what fun scripts ppl come up with. lets have fun and post some fun useful shell scripts. post it in code wrapping and give it a name that describes what it does and possible a small description.
KEEP IN MIND this is not to discuss issues or problems with a script, lets keep it clean and have fun.
this is my fake logon script.
so basically what this script does when ran at login via terminal, is it will first say "access denied" as if you got the password wrong then ask you to retype it, but security its a fake logon , so you would enter the name that you specified and if correct it will let you in but if wrong i will kill that session with the username specified at the bottom of the sript
I edited my /etc/bash.bashrc file to run at login (vis SSH)
I edited my /etc/pam.d/login and /etc/pam.d/sshd to get rid of the junk that shows up at login
I ran touch ~/.hushlogin to get rid of the other junk at login
here is the script
#!/bin/bash
S="sleep .5"
N="~"
Name="some name"
echo "Access denied"
$S
read -s -p "`whoami`@ipaddress's password:" username
echo ""
if [ "$username" = "$Name" ];then
echo 'Success!!! You are now logged in.'
else
echo 'Sorry, Access Denied.'
echo $N
$S
echo $N
$S
echo $N
$S
echo "*~~~ip logged~~~> `who`"
echo 'Good Bye'
pkill -KILL -u username
pkill -KILL -u another username
fi
text in colors you will have to change for your system
if you mess this script up some how and it just automatically logs you out you can always CTRL+C to cancel it before it kicks you out. (i learned this the hardway :))
any questions about my script just fell free to PM me.