Page 1 of 2

No telnet or ssh

Posted: Mon Apr 28, 2014 3:05 pm
by steveM
I'm running the latest Raspbian (downloaded today) and am trying to telnet or ssh into it without a keyboard or monitor from an xp laptop.

Earlier today I had access to a monitor, installed telnet, confirmed ssh was running and entered a static ip address.

I can ping the pi but cannot ftp, telnet or ssh into it.

Telenet returns:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Steve>telnet 10.10.10.3
Connecting To 10.10.10.3...Could not open connection to the host, on port 23: Co
nnect failed

ssh using putty I get a screen that just sits there eventually displaying "Network error: connection timed out."

I'm at a loss here, clearly something is not right but I cant figure out what it is.

Re: No telnet or ssh

Posted: Mon Apr 28, 2014 3:08 pm
by steveM
oops the ssh error should read "... connection refused"

Re: No telnet or ssh

Posted: Mon Apr 28, 2014 3:17 pm
by RaTTuS
Stick with ssh
how are you connection up the RPi and your windows machine ?
via a router or switch or direct connect ?

Re: No telnet or ssh

Posted: Mon Apr 28, 2014 4:03 pm
by steveM
Direct connect

Re: No telnet or ssh

Posted: Mon Apr 28, 2014 4:05 pm
by RaTTuS
and have you forced the windows machine to be on the same network ?

what does
ipconfig
say on the windows machine

Re: No telnet or ssh

Posted: Mon Apr 28, 2014 4:23 pm
by steveM
Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.10.10.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
IP Address. . . . . . . . . . . . : fe80::224:e8ff:fead:649d%4
Default Gateway . . . . . . . . . : 10.10.10.3

Tunnel adapter Teredo Tunneling Pseudo-Interface:

Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : fe80::ffff:ffff:fffd%6
Default Gateway . . . . . . . . . :

Tunnel adapter Automatic Tunneling Pseudo-Interface:

Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : fe80::5efe:10.10.10.2%2
Default Gateway . . . . . . . . . :

C:\Documents and Settings\Steve>

Re: No telnet or ssh

Posted: Mon Apr 28, 2014 10:13 pm
by DougieLawson
Shut down the RPi
Stick the SDCard in your Windows system
Edit F:\cmdline.txt (use notepad, wordpad or editpadlite7)
add
ip=10.10.10.143
to the end of that file.
Save

Boot the RPi from the card and you'll be able to connect to that IP address.

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 6:02 am
by steveM
I entered the ip address as described.

i lost connectivity using 10.10;.10;.3 but 10.10.10.143 returned pings.

telnet returned:
C:\Documents and Settings\Steve>telnet 10.10.10,143
Connecting To 10.10.10,143...Could not open connection to the host, on port 23:
Connect failed

ssh returned:
Network error: connection refused

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 7:27 am
by DougieLawson
To use telnet you need telnetd running on your RPi.

The default system includes the much more secure sshd. So use that. The client program to use on windows is PuTTY (free download). The client to use on an android phone is JuiceSSH.

sshd uses port 22.

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 2:41 pm
by steveM
I took my Pi to work, connected it to a TV and used raspconfig (?) to start ssh.

ssh now works but I cannot get telnet. I much prefer telnet over ssh. The windows command prompt does everything I want.

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 2:42 pm
by DougieLawson
If you insist it should work with
sudo apt-get install telnetd

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 2:54 pm
by steveM
I have done that, here's what I got:

root@WFYC:/# sudo netstat -a grep | telnet
-bash: telnet: command not found

^Croot@WFYC:/# apt-get install telnetd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
openbsd-inetd
The following NEW packages will be installed:
openbsd-inetd telnetd
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 77.4 kB of archives.
After this operation, 211 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main openbsd-inetd armhf 0.20091229-2
Temporary failure resolving 'mirrordirector.raspbian.org'
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main telnetd armhf 0.17-36
Temporary failure resolving 'mirrordirector.raspbian.org'
Failed to fetch http://mirrordirector.raspbian.org/rasp ... _armhf.deb Temporary failure resolving 'mirrordirector.raspbian.org'
Failed to fetch http://mirrordirector.raspbian.org/rasp ... _armhf.deb Temporary failure resolving 'mirrordirector.raspbian.org'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@WFYC:/# ^Croot@WFYC:/# apt-get install telnetd
After this operation, 211 kB of additional disk space will be used.
-bash: :s^Croot@WFYC:/# apt-get install telnetd: substitution failed
Do you want to continue [Y/n]? y
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main openbsd-inetd armhf 0.20091229-2
root@WFYC:/# Reading package lists... Done
-bash: Reading: command not found
root@WFYC:/# Building dependency tree
-bash: Building: command not found
root@WFYC:/# Reading state information... Done
-bash: Reading: command not found
root@WFYC:/# The following extra packages will be installed:
-bash: The: command not found
root@WFYC:/# openbsd-inetd
-bash: openbsd-inetd: command not found
root@WFYC:/# The following NEW packages will be installed:
-bash: The: command not found
root@WFYC:/# openbsd-inetd telnetd
-bash: openbsd-inetd: command not found
root@WFYC:/# 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
-bash: 0: command not found
root@WFYC:/# Need to get 77.4 kB of archives.
-bash: Need: command not found
root@WFYC:/# After this operation, 211 kB of additional disk space will be used.
-bash: After: command not found
root@WFYC:/# Do you want to continue [Y/n]? y
-bash: Do: command not found
root@WFYC:/# Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main openbsd-inetd armhf 0.20091229-2
-bash: Err: command not found
root@WFYC:/# Temporary failure resolving 'mirrordirector.raspbian.org'
-bash: Temporary: command not found
root@WFYC:/# Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main telnetd armhf 0.17-36
-bash: Err: command not found
root@WFYC:/# Temporary failure resolving 'mirrordirector.raspbian.org'
-bash: Temporary: command not found
root@WFYC:/# Failed to fetch http://mirrordirector.raspbian.org/rasp ... _armhf.deb Temporary failure resolving 'mirrordirector.raspbian.org'
-bash: Failed: command not found
root@WFYC:/# Failed to fetch http://mirrordirector.raspbian.org/rasp ... _armhf.deb Temporary failure resolving 'mirrordirector.raspbian.org'
-bash: Failed: command not found
root@WFYC:/# E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
-bash: E:: command not found
root@WFYC:/# root@WFYC:/#
-bash: root@WFYC:/#: No such file or directory

I see lots of "Done"s and lots of "Error"s

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 5:20 pm
by DougieLawson
I see a broken network that doesn't have the right settings for ip address, gateway, netmask and/or nameserver.

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 6:10 pm
by Joe Schmoe
I see dead system(s).

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 6:50 pm
by steveM
Its not that. I didn't know I needed an internet connection so did not set it up.

In an effort to connect to the internet I changed the pi from static to DHCP. I've now lost connectivity with it and my laptop. The pi does not seem to respond to the DHCP server.

Oh what a mess I'm in :oops:

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 8:01 pm
by DougieLawson
You'll need a USB keyboard, HDMI cable and a TV to unfurl that.

Or clean the SDCard with the SDFormatter (use FORMAT SIZE ADJUSTMENT ON) and start again with a fresh install.

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 9:12 pm
by steveM
I reloaded the operating system but the pi and xp laptop still don't talk.

I thought the pi was defaulted to a Dynamic ip address and should pick up the address from the laptops DHCP.

Re: No telnet or ssh

Posted: Tue Apr 29, 2014 9:23 pm
by DougieLawson
Get a copy of Fing. It will search your network looking for IP addresses that in use.
http://www.overlooksoft.com/download

The Android version of Fing is very funky and a very useful tool (and has a brilliant price £0.00, I'd happily pay a fiver for it).

DHCP works from your router, not from your Laptop.

You could insert your SDCard in your Laptop. Edit F:\cmdline.txt and add ip=169.254.3.14 on the end of the ONE line (don't add a new line). Boot that and your RPi will get a known IP address, when you plug it directly into your laptop (no router) you'll be able to connect at 169.254.3.14.

Re: No telnet or ssh

Posted: Thu May 01, 2014 11:21 am
by steveM
For some inexplicable reason I omitted to enable the DHCP server (Tftpd32) on my laptop. That done I can now access the pi every time using ssh.

With no internet I cannot load telnet using apt-get. I copied Packages.bz2 & Packages.gz from the pi website to my laptop as apt-get would have done. I guess I have to tell apt-get to look on the laptop instead of the pi site to complete the install.

Re: No telnet or ssh

Posted: Thu May 01, 2014 11:37 am
by DougieLawson
You've lost me, why would a FTP daemon have anything to do with your wonky network configuration?

Re: No telnet or ssh

Posted: Thu May 01, 2014 11:45 am
by steveM
It wouldn't.

I now have a good local network connection to my laptop.

What I need now is to install telnetd on my pi so I can telnet onto my pi.

Re: No telnet or ssh

Posted: Thu May 01, 2014 11:46 am
by DougieLawson
steveM wrote:What I need now is to install telnetd on my pi so I can telnet onto my pi.
Why do you think you need telnetd? What's wrong with using sshd (on the Pi) with PuTTY (on Windows)?

Re: No telnet or ssh

Posted: Thu May 01, 2014 11:47 am
by rpdom
You can manually download the files required.
First you should run

Code: Select all

apt-get --print-uris install whateveryouwant
This will give you a list of files to download and where to download them from. You can do that on your PC.

Then you need to copy the files to your Pi in directory /var/cache/apt/archives

Then you do a normal sudo apt-get install whateveryouwant and it will use the files that you have already downloaded.

However, telnet and ftp are old and insecure. You can use them if you wish. But it sounds like your network still isn't configured correctly. Perhaps the default gateway (router - in this case your PC) isn't set?

Re: No telnet or ssh

Posted: Thu May 01, 2014 12:12 pm
by steveM
Putty is just so complicated, no put or get commands and it's yet another application to install and learn. Why would you want to use it?

With the command prompt, telnet and ftp I can do anything. I'm on a simple network with a laptop and a pi so there are no security issues.

Re: No telnet or ssh

Posted: Thu May 01, 2014 12:17 pm
by Joe Schmoe
steveM wrote:Putty is just so complicated, no put or get commands and it's yet another application to install and learn. Why would you want to use it?

With the command prompt, telnet and ftp I can do anything. I'm on a simple network with a laptop and a pi so there are no security issues.
+1 on this.

Putty is totally weird. I say this as one who has been using it for years and has figured out and workarounded most/all of Putty's weirdness, but it is certainly not a thing of beauty in terms of UI/configuration design.

One wishes there was a simple command line ssh client for Windows, like there is in Linux/Unix. I suppose there probably is, in Cygwin, but then you get into the whole morass of Cygwin weirdness.