joey-world Posted April 15, 2013 Share Posted April 15, 2013 Hello guys, I'm playing around with ubuntu server 12.04. I was wondering how can I send some sort of notification to my android cellphone when someone sucesfully login at the server? and also setup failed attempted logins? The scenario looks like this: I have a server at home, which can be accessed from another network for managing purposes or why not. Some random person finds possible to enter my network, and is trying to login to my server. I want a notification as soon as possible, so I can remotely shut down the server or do something about the incident. What you guys think? is that possible? If so how? Thank you again guys. Quote Link to comment Share on other sites More sharing options...
Mr-Protocol Posted April 15, 2013 Share Posted April 15, 2013 This may help. http://askubuntu.com/questions/179889/how-do-i-set-up-an-email-alert-when-a-ssh-login-is-successful Quote Link to comment Share on other sites More sharing options...
digininja Posted April 15, 2013 Share Posted April 15, 2013 Some random person finds possible to enter my network, and is trying to login to my server. This bit worries me slightly, are you saying that this server is only accessible from inside the network? i.e. you've not just port forwarded ssh through your external interface. If that is the case then having someone on your internal network is something you want to be more concerned about. For monitoring failed attempts then I'd suggest fail2ban. It locks out the offending IP after a given number of failed attempts and can optionally send you an email with the details in it. Quote Link to comment Share on other sites More sharing options...
digip Posted April 15, 2013 Share Posted April 15, 2013 I was going to sya use a script to send an email, but digininja pretty much summed it up. I don't see why it has to be some sort of text/push notification since android phones can receive email, unless you don't have that with your data plan, you could go third party services that receives the email and then sends to you as a text message if you can't do email on the plan you have. Quote Link to comment Share on other sites More sharing options...
joey-world Posted April 15, 2013 Author Share Posted April 15, 2013 This bit worries me slightly, are you saying that this server is only accessible from inside the network? i.e. you've not just port forwarded ssh through your external interface. If that is the case then having someone on your internal network is something you want to be more concerned about. For monitoring failed attempts then I'd suggest fail2ban. It locks out the offending IP after a given number of failed attempts and can optionally send you an email with the details in it. I want it to be well rounded, of course I forwarded the external SSH to the server, but I want also to protect if in case the network was opened and they are doing it from the inside, since I will be the only one to have access to it, the users inside of the network are a worry too. thank you for your reply. Quote Link to comment Share on other sites More sharing options...
joey-world Posted April 15, 2013 Author Share Posted April 15, 2013 I was going to sya use a script to send an email, but digininja pretty much summed it up. I don't see why it has to be some sort of text/push notification since android phones can receive email, unless you don't have that with your data plan, you could go third party services that receives the email and then sends to you as a text message if you can't do email on the plan you have. I do have a data plan, but I will have to wait until the android syncs the email to recieve the notification, If I recieve a text message it would be faster the notification. Thank you for your opinion. :) Quote Link to comment Share on other sites More sharing options...
joey-world Posted April 15, 2013 Author Share Posted April 15, 2013 This may help. http://askubuntu.com/questions/179889/how-do-i-set-up-an-email-alert-when-a-ssh-login-is-successful Let me check it out. Thank you for the info. Quote Link to comment Share on other sites More sharing options...
digip Posted April 15, 2013 Share Posted April 15, 2013 Is lastlogin a standard thing on linux as well, or is that an extra package or service you'd have to install. Was just thinking, I've seen .lastlogin files on sites before that I assume are created automatically by some other monitoring process, and shows the IP of the last person to SSH into the site(not talking about lastlogin command, but an actual .lastlogin file in the root or home folder), wonder if there is a way to just monitor the file for changes and then shoot off an email if its md5 changes or such. Not sure how to go about setting it up or what package its part of, but just another idea to throw into the mix(if it is some other already existing monitoring software that does this). Quote Link to comment Share on other sites More sharing options...
demortes Posted May 19, 2013 Share Posted May 19, 2013 (edited) Why not just send an email to the text messaging interface for your phone? Like I'm on verizon, I can do <phonenumber>@vtext.com See http://www.emailtextmessages.com/ to find your particular email address. Also sometimes, MMS can be done this way too. Edited May 19, 2013 by demortes Quote Link to comment Share on other sites More sharing options...
digip Posted May 20, 2013 Share Posted May 20, 2013 The above post makes a lot of sense. I used to email friends at their phone numbers to send them text messages back in the day, so thats always an option, but also just regular email on phones these days since most every smart phone accepts email. Also, I recently saw something about a messaging system, that can send to cell phones, and also sends them encrypted, but it was on twitter, and I don't have the link. If I am right, @ioerror might have been the one to tweet it or someone on his friends list/retweet, that lets you send encrypted text messages and chat on the phones, and also decide how long the message lives on the servers, like, if I want to send John Dow a Text, but only want that text to live for 2 hours and then never exist or be stored anywhere, if he doesn't read it, it removes it from wherever somehow... I don't remember everything about how it worked or if it was a service or program you could download, but I know it was talked about on twitter and compared to skype, but safer and only meant for cell phones I believe. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.