LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 04-25-2007, 12:16 AM   #1
epoo
Member
 
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Rep: Reputation: 30
emailing script results from someone else's pc


I'm setting up a pc for my girlfriends's grandparents. They have windows right now but always end up with spyware, and I'm planning on installing kubuntu on it. They know very little about computers. What I want to do is to enable remote desktop, then write a script that will look at whatismyip.com and email me their external ip address every few days, so that I can connect to their machine when they have a problem, and dont have to explain how to find their ip or go fix it myself. Will this work ? I'm concerned about having the security involved in having the port open and forwarded for the remote desktop, and having a mail server running on their pc for such a small and possibly unnecessary task. And probably a dumb question, but by simply running a mail server on their pc, is that all I need to do to send an email to my gmail account ?
 
Old 04-25-2007, 12:56 AM   #2
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
Quote:
Originally Posted by epoo
I'm concerned about having the security involved in having the port open and forwarded for the remote desktop, and having a mail server running on their pc for such a small and possibly unnecessary task. And probably a dumb question, but by simply running a mail server on their pc, is that all I need to do to send an email to my gmail account ?
You will be able to send outgoing messages from the PC, but since the sending IP will likely not have a reverse entry, it will probably end up in your bulk/junk/spam folder.

How is the PC connected by the way? If it is assigned a private IP by their ISP, you won't have access to them from outside their network unless their is some DNAT implemnetation on the gateway.
 
Old 04-25-2007, 08:42 AM   #3
doc.nice
Member
 
Registered: Oct 2004
Location: Germany
Distribution: Debian
Posts: 274

Rep: Reputation: 34
take a look at www.dyndns.org...
 
Old 04-25-2007, 09:29 AM   #4
vanstra
Member
 
Registered: Mar 2005
Distribution: Ubuntu 10.04 - CentOS 5.4
Posts: 40

Rep: Reputation: 15
Use ddclient in combination with the free service www.dyndns.org
 
Old 04-25-2007, 11:13 AM   #5
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
Quote:
Originally Posted by doc.nice
take a look at www.dyndns.org...
Won't have much of an impact if he's given a non-routable IP. dyndns.org will only be useful if he's assigned a random Public IP or if the ISP agree to do port forwarding for him. What type of IP are you being assigned epoo?

Quote from www.dyndns.com FAQ:
Can I use your services for a server behind a cable/DSL router?

Yes. You'll have to set up port forwarding on your router; see your documentation for instructions. Then just point your hostname(s) at the router's external IP as normal, and it should handle sending the right traffic to your internal server.

Last edited by SlackDaemon; 04-25-2007 at 11:18 AM.
 
Old 04-25-2007, 12:15 PM   #6
General Failure
Member
 
Registered: Jan 2007
Location: Germany
Distribution: Slackware 13.37
Posts: 387

Rep: Reputation: 35
What I did in a similar case:

I just had sshd running on the remote machine and wrote a little script that used kdialog to open a window and display the IP address.

I placed that on the desktop, called it "Determine IP Address" and when they had a problem, they just clicked on it and told me the IP by phone - hassle-free and also much more secure than sending it by mail. You also don't need to have an mta running which is good as well.

You can also do X11 forwarding over ssh but I never did that. Thought I should mention it tho
 
Old 04-25-2007, 04:17 PM   #7
epoo
Member
 
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by SlackDaemon
You will be able to send outgoing messages from the PC, but since the sending IP will likely not have a reverse entry, it will probably end up in your bulk/junk/spam folder.

How is the PC connected by the way? If it is assigned a private IP by their ISP, you won't have access to them from outside their network unless their is some DNAT implemnetation on the gateway.
They'll have a dynamic ip from a cable internet provider. I've got the same isp, and the ip changes maybe once every few weeks. Mail ending up in the spam folder would be ok. I would almost be better, since it's deleted every 30 days, and I would probably never need to use it, if they had a problem I could check the spam folder, and if they didn't it would be automatically deleted.

Quote:
Originally Posted by doc.nice
take a look at www.dyndns.org.
Thanks, I'll take a look at that later.

Quote:
Originally Posted by General Failure
I just had sshd running on the remote machine and wrote a little script that used kdialog to open a window and display the IP address.

I placed that on the desktop, called it "Determine IP Address" and when they had a problem, they just clicked on it and told me the IP by phone - hassle-free and also much more secure than sending it by mail. You also don't need to have an mta running which is good as well.

You can also do X11 forwarding over ssh but I never did that. Thought I should mention it tho
That's a good idea. So all I would need to do for that would be to set up an SSH server on their pc, enable the remote desktop app, and do a port forwarding on their router of the SSH port (I would probably set it up to use something other than 22) to their pc, right ?

After reading all this, I'm thinking I might skip the email idea. A little script that wouldn't require a mail server to be run would probably be a better idea.
 
Old 04-26-2007, 07:27 AM   #8
General Failure
Member
 
Registered: Jan 2007
Location: Germany
Distribution: Slackware 13.37
Posts: 387

Rep: Reputation: 35
Quote:
Originally Posted by epoo
After reading all this, I'm thinking I might skip the email idea. A little script that wouldn't require a mail server to be run would probably be a better idea.
Yeah think so too.
Quote:
So all I would need to do for that would be to set up an SSH server on their pc, enable the remote desktop app, and do a port forwarding on their router of the SSH port (I would probably set it up to use something other than 22) to their pc, right ?
Basically yes, but as I said I dunno about those remote desktop apps. And btw personally I don't think it's necessary to try to hide the port by changing it. This doesn't help too much if someone should really do a portscan on that machine.

If you want to be safe, create a special user account for that purpose, disable logins from all other users and give the one allowed user a bulletproof password.
 
Old 04-26-2007, 10:04 AM   #9
reverse
Member
 
Registered: Apr 2007
Distribution: Gentoo
Posts: 337

Rep: Reputation: 30
Do you plan on connecting from various machines? Do you know which these are? Do you know their IPs? If you have answered "yes" to all of the above questions, you win a prize: a suggestion = why not set up a firewall and make sure you're the only one who can get in?

As for the whole "some way to get their IP address".. here's a stupid idea: make a shortcut on their desktop that does nothing more than "wget <some_website>/somescript.php" (or something). What does somescript.php do? Write to a text file the "remote address" and the access time to a file. Then simply check that file. I find that easier than having an email server on their box .. and highly simpler/easier methods can be found, I'm sure.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with DD and emailing the results booyaadewd Linux - Newbie 6 09-22-2006 03:48 PM
[crontab] emailing non-empty results G00fy Programming 5 09-20-2006 01:16 AM
Emailing after script run? phatboyz Linux - General 4 06-20-2006 04:48 PM
Trigger script by SSHD failues and emailing commands... juanbobo Programming 1 08-18-2005 08:38 AM
script for emailing mysql data MrJoshua Programming 5 06-14-2005 01:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration