Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-16-2013, 09:55 AM
|
#1
|
Member
Registered: Nov 2008
Posts: 47
Rep:
|
Make Linux send message to server at Login
Hi all,
As a security measure I would like my laptop (which runs Fedora LXDE native) to send a message via the network to some server of my choice at login and other events (when logged in). The message will contain info such as IP and maybe other details. This way if it was stolen I can track it down when they try to switch it on.
How might I be best to go about this?
|
|
|
12-16-2013, 10:09 AM
|
#2
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Anybody who would steal a laptop and then boot up the installed OS with it connected to the internet is a moron. I think the chances of that happening are slim to none. You'd be better off securing your data and then making sure it doesn't get stolen in the first place.
|
|
1 members found this post helpful.
|
12-16-2013, 10:11 AM
|
#3
|
Member
Registered: Nov 2008
Posts: 47
Original Poster
Rep:
|
Sure, but wouldn't it be great if they did do it...?
|
|
|
12-16-2013, 11:01 AM
|
#4
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
Quote:
Originally Posted by suicidaleggroll
Anybody who would steal a laptop and then boot up the installed OS with it connected to the internet is a moron. I think the chances of that happening are slim to none. You'd be better off securing your data and then making sure it doesn't get stolen in the first place.
|
i agree, but then again many ( not most) crooks are morons. so in that slim chance ( 10% ?) maybe it is worth putting a 1-liner into the /etc/rc.local file.
Code:
ssh stolen@whatever.floats.your.boat &
this produces a line in /var/log/secure
Code:
Dec 16 11:17:24 hyper sshd[3322]: Invalid user stolen from 192.168.1.34
they would obviousely need internet access. they probably would be on wifi so they would need to know how to log into the machine in order to use network-manager to select an ssid.
Last edited by schneidz; 12-17-2013 at 09:38 AM.
|
|
|
12-16-2013, 11:29 AM
|
#5
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Quote:
Originally Posted by supasoaker
Sure, but wouldn't it be great if they did do it...?
|
And wouldn't it be great if they saw a label on the computer with your name and phone number and returned it to you? It's a pipe dream. Yes while thieves are idiots, they're generally not that stupid. If they were that stupid they wouldn't have been able to grab the computer without anybody noticing or saying anything in the first place.
Either way, you could add a cronjob that runs every X minutes that grabs the IP and pushes it to a 3rd party ftp/sftp server. But remember that in order for this to work, the computer needs to be able to log into that server without a password, which means that once the thief does get into the computer, they can then log into your server.
I have a similar script that runs on my home machine, but it's not to protect against theft, its to monitor my current public IP so that if it changes while I'm away from home, I know what the new address is. I'll let you deal with the logistics of securing it so the thief can't work their way backwards through your security and access your main system.
Code:
# on my web hosting machine
$ cat ip.php
<?php echo $_SERVER['REMOTE_ADDR']?>
Code:
# on the machine running this code
$ cat getip
wget -q -O - http://www.mywebhostingmachine.com/ip.php
$ cat autoip
#!/bin/bash
/path/to/getip > currentip.dat
ftp -dvin www.mywebhostingmachine.com <<EOF
quote USER myuser
quote PASS mypass
put currentip.dat
quit
EOF
rm -f currentip.dat
exit 0
$ crontab -l
0 * * * * /path/to/autoip > /dev/null 2>&1
The file "currentip.dat" exists on the web hosting machine, and it contains the public IP of the machine that is running the above commands, updated once per hour.
Last edited by suicidaleggroll; 12-16-2013 at 11:31 AM.
|
|
|
12-16-2013, 11:35 AM
|
#6
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
Quote:
Originally Posted by suicidaleggroll
And wouldn't it be great if they saw a label on the computer with your name and phone number and returned it to you? It's a pipe dream. Yes while thieves are idiots, they're generally not that stupid. If they were that stupid they wouldn't have been able to grab the computer without anybody noticing or saying anything in the first place...
|
on the lock screen of my fone i have a picture with embedded text (email address). more than likely the fone will be gone forever if lost; but there is a 2% chance some nice person will email inquiring about an award if returned ?
|
|
|
12-16-2013, 11:37 AM
|
#7
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Quote:
Originally Posted by schneidz
on the lock screen of my fone i have a picture with embedded text (email address). more than likely the fone will be gone forever if lost; but there is a 2% chance some nice person will email inquiring about an award if returned ?
|
Sure, but then it hasn't been "stolen", it's been "found", and the person who found it wasn't a thief.
|
|
|
12-16-2013, 10:43 PM
|
#8
|
Senior Member
Registered: Apr 2010
Posts: 2,285
|
Quote:
Originally Posted by supasoaker
Hi all,
As a security measure I would like my laptop (which runs Fedora LXDE native) to send a message via the network to some server of my choice at login and other events (when logged in). The message will contain info such as IP and maybe other details. This way if it was stolen I can track it down when they try to switch it on.
How might I be best to go about this?
|
Just curious, let's say if you will have a software that it's working perfectly fine and able to do what you want.
So from that day onward, you have to anticipate that someone will take your box. To prove that your idea is working.
Knock the wood..just kidding..
Prevention is better than a pound of cure.. 
|
|
|
12-17-2013, 04:33 AM
|
#9
|
Member
Registered: Nov 2008
Posts: 47
Original Poster
Rep:
|
Hi all,
Thanks for all the input!
I would say the message needs to be sent when the login screen is accessed, so either the laptop is in a 'suspend' state and then a user wakes it up to login or the laptop is turned on.
This is obviously impractical as the amount of times I put the laptop in suspend mode would max my inbox in a matter of months. It would also annoy me. I will ponder this a bit more maybe...
I got the idea from an article with a guy who actually did it, I will try and find more info and post if anyone is interested, but think this might be a windows system. He caught the guy and even managed to get a video that he posted on YouTube of him dancing to a song using his old laptop! Apparently it went viral...
Thanks for the code examples! Either way these are great for advancing my general knowledge, thanks a bunch!
Last edited by supasoaker; 12-17-2013 at 04:37 AM.
|
|
|
12-18-2013, 12:31 AM
|
#10
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
You could always configure the laptop to send its syslog messages to some server. Any modern syslog implementation can do this. The problem, aside from the ones mentioned above about no crook with brains powering on your laptop with an active network connection, with this is that having a poublicly available syslog server on the Internet is probably not such a great idea. However, it is fairly trivial to do. You could then set up something like logwatch on the remote syslog server to e-mail youi when certain events are logged.
From what I've heard, most stolen laptops are simply wiped and sent to the pawn shop, so this is probably not too likely to help given the trouble involved.
|
|
|
12-19-2013, 01:17 PM
|
#11
|
Member
Registered: Nov 2010
Distribution: Lubuntu, Raspbian, Openelec, messing with others.
Posts: 143
Rep:
|
Quote:
Originally Posted by suicidaleggroll
Anybody who would steal a laptop and then boot up the installed OS with it connected to the internet is a moron. I think the chances of that happening are slim to none. You'd be better off securing your data and then making sure it doesn't get stolen in the first place.
|
And I know of multiple instances where Lowjack for Windows has been used sucessfully to recover them (Law enforcement relative).
I looked at that program, some years back, but a Linux version wasn't available at the time (no idea now). I did find some ways people had done something similar with Linux and at the time a couple of people trying to make a Linux version (couldn't find them again, don't think they happened).
In the end it was part of the reason I went a separate way (os on a USB key with data that needs secured on it or in an encrypted partition, the rest of the drive as open storage for non important stuff).
|
|
|
All times are GMT -5. The time now is 11:02 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|