Blind ssh connectin a problem
39 posts
Page 2 of 2 1, 2
peguintutor - can you add links to your guides to http://elinux.org/RPi_Guides please? 
nmap
http://nmap.org/
Handiest thing in the world for finding stuff on a network. Not got my pi yet but its in the Debian ARM repository I use on my ARM box. There is a certain degree of paranoia in some quarters surrounding such software, you have been warned. Available for Windoze & Mac
nmap 192.168.1.0/24
will work on many modern router networks (192.168.1.X).
Devices with port 22 open are a good place to start
http://nmap.org/
Handiest thing in the world for finding stuff on a network. Not got my pi yet but its in the Debian ARM repository I use on my ARM box. There is a certain degree of paranoia in some quarters surrounding such software, you have been warned. Available for Windoze & Mac
nmap 192.168.1.0/24
will work on many modern router networks (192.168.1.X).
Devices with port 22 open are a good place to start
Don't judge Linux by the Pi.......
Thank you very much Penguin. This is exactly what I was looking for.
Cheers!
Cheers!
- Posts: 3
- Joined: Mon Jul 02, 2012 10:26 am
I connected the raspberry pi to the network in my workplace. To find the ip for connecting using ssh
I just did a ping from Windows Command Line using the default name raspberrypi and it provided the ip address.
C:\Users\chistrix>ping raspberrypi
Pinging raspberrypi.prt.local [10.13.7.243] with 32 bytes of data:
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Ping statistics for 10.13.7.243:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
I just did a ping from Windows Command Line using the default name raspberrypi and it provided the ip address.
C:\Users\chistrix>ping raspberrypi
Pinging raspberrypi.prt.local [10.13.7.243] with 32 bytes of data:
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Ping statistics for 10.13.7.243:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
- Posts: 1
- Joined: Mon Jul 30, 2012 5:18 pm
Why not use serial, or make sure it has a fixed ip?
- Posts: 96
- Joined: Sun Jul 22, 2012 2:25 pm
Another option would be an app like Fing http://www.overlooksoft.com/download
Chistrix wrote:I connected the raspberry pi to the network in my workplace. To find the ip for connecting using ssh
I just did a ping from Windows Command Line using the default name raspberrypi and it provided the ip address.
C:\Users\chistrix>ping raspberrypi
Pinging raspberrypi.prt.local [10.13.7.243] with 32 bytes of data:
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Reply from 10.13.7.243: bytes=32 time<1ms TTL=64
Ping statistics for 10.13.7.243:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Try it home and see what happens. If you're not running a DNS server, your Windows PC won't be able to look up the hostname 'raspberrypi'.
And the quoted post brings up a point that I wanted to mention. Preconfiguring for a 192.168.x.x address is a bad idea when you don't know if the user might actually be wanting an 10.x.x.x address.
http://mmm-pi.co.uk - my adventures with a Pi
- Posts: 22
- Joined: Thu Jul 19, 2012 10:53 am
- Location: Cambridge, UK
I went a Little different route.
Edit /etc/rc.local <nano, vi, joe: your choice>
insert the following line after, 17: "printf :My IP adress is..."
Then on the server side, add a PHP Script:
You end up with a txt file on the webserver that looks like this:
Then just bookmark the url for your text file, and you can always get your PI IP.
YMMV.
Edit /etc/rc.local <nano, vi, joe: your choice>
insert the following line after, 17: "printf :My IP adress is..."
- Code: Select all
curl http://www.yourwebsite.com/pi-ip/?id=pi_one\&addr=$_IP
Then on the server side, add a PHP Script:
- Code: Select all
<?php
$pi_id = $_REQUEST['id']; // If you have more then one pi.
$pi_addr = $_REQUEST['addr'];
$date = date('c');
$myFile = "tr_".$pi_id.".txt";
$fh = fopen($myFile, 'a') or die("can't open file");
fwrite($fh, $date ."|". $pi_addr ."\n");
fclose($fh);
?>
You end up with a txt file on the webserver that looks like this:
- Code: Select all
2012-07-30T14:52:07-04:00|192.168.30.99
2012-07-30T14:55:00-04:00|192.168.39.12
2012-07-30T14:59:00-04:00|192.168.39.10
Then just bookmark the url for your text file, and you can always get your PI IP.
YMMV.
- Posts: 7
- Joined: Thu Jan 12, 2012 4:39 pm
e90jimmy wrote:I went a Little different route.
Then just bookmark the url for your text file, and you can always get your PI IP.
How do you access the text file to obtain the IP address when you don't know the IP address to connect to the Pi to obtain the text file?
http://mmm-pi.co.uk - my adventures with a Pi
- Posts: 22
- Joined: Thu Jul 19, 2012 10:53 am
- Location: Cambridge, UK
bursar wrote:e90jimmy wrote:I went a Little different route.
Then just bookmark the url for your text file, and you can always get your PI IP.
How do you access the text file to obtain the IP address when you don't know the IP address to connect to the Pi to obtain the text file?
I think he's assuming you've got a web server elsewhere.
Actually now I think about it you could also use the little script I wrote last week (which was written for security checking) which emails you (using a googlemail account) the IP address of the Pi and lots of other info too. If that's of interest I can post the latest version. If not, no worries.
- Posts: 7
- Joined: Thu Jan 12, 2012 4:39 pm
I also tried mailing the ip address on boot, but quickly found neither mail or mailx were installed.
I am using the Raspbian build.
Step One install, mailx
Edit /etc/ssmtp/ssmtp.conf, update mailhub to gmail, change hostname, and add AuthUser, AuthPath, UseSTARTTTLS.
Send Test Email:
Add the mail command to /etc/rc.local
Reboot Raspberry Pi
Check Email
I am using the Raspbian build.
Step One install, mailx
- Code: Select all
$ sudo apt-get install bsd-mailx ssmtp
Edit /etc/ssmtp/ssmtp.conf, update mailhub to gmail, change hostname, and add AuthUser, AuthPath, UseSTARTTTLS.
- Code: Select all
mailhub=smtp.gmail.com:587
hostname=<YOUR HOSTNAME>
AuthUser=<gmail_address>@gmail.com
AuthPass=<gmail_password>
UseSTARTTLS=YES
Send Test Email:
- Code: Select all
/usr/bin/mail -s "my ipaddress `hostname -I`" <youremailaddress> < /etc/motd
Add the mail command to /etc/rc.local
- Code: Select all
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
/usr/bin/mail -s "my ipaddress $_IP" <youremail> < /etc/motd
# edit: need full path to mail, and some file for content, Message of the day will work.
fi
exit 0
Reboot Raspberry Pi
Check Email
- Posts: 7
- Joined: Thu Jan 12, 2012 4:39 pm
e90jimmy wrote:I also tried mailing the ip address on boot, but quickly found neither mail or mailx were installed.
Nice solution. Mine uses a googlemail account and python to do the sending.
I did it like mentioned above: with "nmap 192.168.1.0/24" (or whatever ifconfig tells me to use as a net). For Windows this could be done with zenmap.
arp-scan, mentioned earlier, seems to work good too.
Now it (usually) uses the same IP, but if in doubt i use nmap again, and it works well.
arp-scan, mentioned earlier, seems to work good too.
Now it (usually) uses the same IP, but if in doubt i use nmap again, and it works well.
- Posts: 109
- Joined: Sun Jun 10, 2012 5:45 am