LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   telnet through lan (https://www.linuxquestions.org/questions/linux-networking-3/telnet-through-lan-238646/)

celadoreuk 10-04-2004 11:26 AM

telnet through lan
 
im a bit new to linux and networking, about three days in fact
but i know a little bit from reading some of the stuff on
aboutdebian dot com-very helpfull site
n e way,
ive got a small office network
4 workstations
1 firewall running debian linux
dsl connection (non-static ip)
otherstuff which i dont think is important

i want to telnet to the firewall from my windows pc, so i run command and get:

c:\>telnet 192.168.0.1
Connecting to 192.168.0.1....could not open connection to the host, on port 23.
no connection could be made because the target machine actively refused it

ive tried it on different ports but it still doesnt work.
(i didnt even know what a port or an ip address was last wednesday)

so how do you set up the linux box to allow this kind of thing?
it must only be for the internal nic for the moment because of security and things.

am i right in thinking telnet will give me a virtual console on the linux box, so as i can do anything i could if i was kneeling down in the dark dusty cupboard where the linux box is, but from the luxury of my own desk?

oh a program called tightvnc is running and works if that helps.

is it something to do with ipchains? does this allow me to specify which ports can deal with which services?

thanks for your time.

Mathieu 10-04-2004 11:57 AM

Did you install the telnet server (service) on the Linux box. By default, telnet is not installed.
In fact, you should not use telnet... use SSH. SSH (secure shell) is an encrypted connection.

SSHd should be installed on your Linux box. It runs on port 22.

On your windows PC, use PuTTY as your SSH client.
http://www.chiark.greenend.org.uk/~sgtatham/putty/

Most likely your firewall is on or the sshd service is not running.
Go to your linux box, login as root. To display your Firewall rules, type:
Code:

iptables -vL
To install (or upgrade) ssh, type:
Code:

apt-get install ssh
Also, you can start, stop, restart sshd with the following command
Code:

/etc/init.d/ssh start

guzzi 10-04-2004 12:20 PM

telnet to firewall
 
hello celadoreuk

I would go with what Mathieu posted. In the past I used telnet because thats what I always did. But this web site has caused me to re-think and go with ssh.

ssh is just like telnet in that you access another unit with the command (ssh ip_address_unit). If you have nothing but trusted units in your network, that only you operate, telnet may be ok. <let the flames begin.>

If you are using iptables for your firewall two lines added to it should get ssh to access that unit. For telnet to work the number would be 23 in place of 22
These two lines show that eth1 faces your internel LAN.

iptables -A INPUT -p tcp -i eth1 --dport 22 -j ACCEPT
iptables -A INPUT -p udp -i eth1 --dport 22 -j ACCEPT

Good Luck.

celadoreuk 10-04-2004 02:14 PM

thanks a lot guys, im impressed with the speedy reply
very helpfull/informative
but ive got another problem
im currently running putty
and i get a log in, so i type root, and the password, but it says access denied
this is a whole step farther than before
because doesnt this mean im actually connected.
sshd thing seems to be running on the linux box because
ps ax cmd lists it

i know the password is right, i logged in a few seconds ago in the actual box.

also, i was inadvertantly helped with another thing
if im wrong please tell me

iptables -A INPUT -p tcp -i eth1 --dport 22 -j ACCEPT
iptables -A INPUT -p udp -i eth1 --dport 22 -j ACCEPT

this allows ports to be used through the eth1 network card?
where tcp or udp is the protocol

so
iptables -A INPUT -p ftp -i ppp0 --dport 21 -j ACCEPT
would allow internet ftp through port 21?
(i found out that although im running some sort of cable thing, its going through a
device which looks like a frog, so its classed as a modem and therefore ppp0?)

that iptables -vL is a headache
i stuck | more on the end, but i cant understand very much of it.

sorry for asking 100 questions in one post, but im learning from scratch.
help with any of them would be much appreciated

celadoreuk 10-04-2004 02:31 PM

sorry i was being an idiot
i managed to get putty working fine
im too embarrassed to say why
cough cough(misspelled password)
so my thanks go out for that


All times are GMT -5. The time now is 05:27 AM.