Jump to content

How to push notifications from server to android


joey-world

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...