Page 1 of 1

telnet to Pi

Posted: Mon Dec 10, 2018 4:47 pm
by Lxw2015
I'm using 2018-11-13-raspbian-stretch-full.img
My linux PC connects to Pi via a switch. I can ping Pi. but when I telnet to Pi, got
Trying 192.168.1.101...
telnet: connect to address 192.168.1.101: Connection refused

search on web, then I enabled SSH on Pi with rasp-config

reboot Pi,

still can't telnet. please give me some clue.
thanks
LXW

Re: telnet to Pi

Posted: Mon Dec 10, 2018 4:51 pm
by scotty101
Have you installed a telnetd on to your Pi? I don't think it installed by default since for most applications, people will use SSH.

SSH != Telnet.

What is your use case for using telnet rather than SSH?

Re: telnet to Pi

Posted: Mon Dec 10, 2018 4:55 pm
by tpyo kingg
Try using the SSH client:

Code: Select all

ssh -l pi 192.168.1.101
Unlike Telnet, the SSH connection is reasonably secure. However, it might be relevant to ask what you are trying to do? Do you have a specific activity that absolutly must have telnet and only telnet? Or are you just trying to connect?

Re: telnet to Pi

Posted: Mon Dec 10, 2018 5:00 pm
by jahboater
Or

ssh pi@192.168.1.101

A couple of simple steps also allows you to securely log in without having to give a password.

Re: telnet to Pi

Posted: Mon Dec 10, 2018 5:09 pm
by Lxw2015
scotty101 wrote:
Mon Dec 10, 2018 4:51 pm
Have you installed a telnetd on to your Pi? I don't think it installed by default since for most applications, people will use SSH.

SSH != Telnet.

What is your use case for using telnet rather than SSH?
thank you. I though telnet is using SSH. I used to use telnet for remote login to Pi. and it works. don't know why not work any more.

Re: telnet to Pi

Posted: Mon Dec 10, 2018 5:12 pm
by Lxw2015
jahboater wrote:
Mon Dec 10, 2018 5:00 pm
Or

ssh pi@192.168.1.101

A couple of simple steps also allows you to securely log in without having to give a password.
thank yo so much. it worked! I wonder what's the diff between SSH and telnet? why telnet won't work?

Re: telnet to Pi

Posted: Mon Dec 10, 2018 5:14 pm
by tpyo kingg
Telnet is not there any more so it won't work. Since 1995 or so, there has been SSH instead.
Lxw2015 wrote:
Mon Dec 10, 2018 5:09 pm
don't know why not work any more.
That would be because telnet is not safe. The user name, password, and all of the data to and from the machine are transfered in the clear, completely unencrypted. The SSH client encrypts everything, plus has a lot more capabilities.

Once you are in you can follow the hint that jahboater has given above and use keys for authentication instead of passwords.

Re: telnet to Pi

Posted: Mon Dec 10, 2018 5:29 pm
by jahboater
On your PC (not on the Pi) type ...

ssh-keygen -t rsa

accept the defaults for all the questions (hit <return> a few times). It probably defaults to rsa, so you may not need the -t option.
Then:

ssh-copy-id pi@192.168.1.101

will transfer the key to your pi (it will ask you for a password).

Then try ssh pi@192.168.1.101
and this time you should go straight in. This is called public/private key authentication and it is far more secure than giving a password - and quicker too.

You may also do

scp myfile pi@192.168.1.101:

and it will copy the file across to your home directory, again very quickly, with no annoying password request.

Finally, on your PC, put something like this in your ~/.bashrc

alias pi='ssh pi@192.168.1.101'

then you can just type pi to log into your Pi.

Re: telnet to Pi

Posted: Mon Dec 10, 2018 5:38 pm
by Lxw2015
thank you so much for further info. I'm so lack of linux stuff.