Is there a chance to keep telnet enabled after the first password change?
I have an application that has telnet integrated an I cannot change it.
Ingo
keep telnet
Moderator: Moderators
Re: keep telnet
To do this you need to edit the start function in /etc/init.d/telnet.
Re: keep telnet
Thanks for the repy, Eric.
I tried to modify the script like this:
# Copyright (C) 2006 OpenWrt.org
START=50
start() {
if [ \! -f /etc/passwd ] || \
awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/p
( [ \! -x /usr/sbin/dropbear ] && [ \! -x /usr/sbin/sshd ] )
then \
telnetd -l /bin/login
fi
}
stop() {
telnetd -l /bin/login
}
I removed the "killall telnet" at the bottom and repalecd it by telnetd config from above..
But no go, telnet connection is still being refused!
Ingo
I tried to modify the script like this:
# Copyright (C) 2006 OpenWrt.org
START=50
start() {
if [ \! -f /etc/passwd ] || \
awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/p
( [ \! -x /usr/sbin/dropbear ] && [ \! -x /usr/sbin/sshd ] )
then \
telnetd -l /bin/login
fi
}
stop() {
telnetd -l /bin/login
}
I removed the "killall telnet" at the bottom and repalecd it by telnetd config from above..
But no go, telnet connection is still being refused!
Ingo
Re: keep telnet
Please see above: you need to change the start function, not the stop function. The stop function just tells it how to shut down.
Re: keep telnet
Hi Eric,
I am not familiar with this script language.
Can you show me what to change to enable both telnet and ssh?
I am afraid to lock me out with ssh and telnet disabled in case of an error in the script.
Regards, Ingo
I am not familiar with this script language.
Can you show me what to change to enable both telnet and ssh?
I am afraid to lock me out with ssh and telnet disabled in case of an error in the script.
Regards, Ingo
Re: keep telnet
I don't understand what u want to do
if you want to reenable telnet:
killall -9 telnet && telnet -l /bin/login
after passwd cmd
ps: use dropbear instead
if you want to reenable telnet:
killall -9 telnet && telnet -l /bin/login
after passwd cmd
ps: use dropbear instead
Re: keep telnet
@ fra&co:
I modified the telnet scrip this way:
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
start() {
killall -9 telnet && telnet -l /bin/login
if [ \! -f /etc/passwd ] || \
awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/p
( [ \! -x /usr/sbin/dropbear ] && [ \! -x /usr/sbin/sshd ] )
then \
telnetd -l /bin/login
fi
}
stop() {
killall telnet
}
But still the telnet connection is being refused.
What I am trying to do:
I have an application on my PC that communicates with the router via telnet.
I cannot change the protocol to ssh, as the provided DLL only support telnet.
But this is no security risk as the router is connected behind the main router running a firewall.
As I am not yet familiar to linux, I am learning it the hard way momentarly...
So I would be very glad to get a hint how to modify the init scripts.
Regards,
Ingo
I modified the telnet scrip this way:
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
start() {
killall -9 telnet && telnet -l /bin/login
if [ \! -f /etc/passwd ] || \
awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/p
( [ \! -x /usr/sbin/dropbear ] && [ \! -x /usr/sbin/sshd ] )
then \
telnetd -l /bin/login
fi
}
stop() {
killall telnet
}
But still the telnet connection is being refused.
What I am trying to do:
I have an application on my PC that communicates with the router via telnet.
I cannot change the protocol to ssh, as the provided DLL only support telnet.
But this is no security risk as the router is connected behind the main router running a firewall.
As I am not yet familiar to linux, I am learning it the hard way momentarly...
So I would be very glad to get a hint how to modify the init scripts.
Regards,
Ingo
Re: keep telnet
Ah, my mistake. You also need to edit /bin/login. Remove everything except the header and the line "exec /bin/ash --login"
Code: Select all
#!/bin/sh
exec /bin/ash --login
Re: keep telnet
Hi Eric,
I just tried it out and it works like a charm!
Thank you!!!
I just tried it out and it works like a charm!
Thank you!!!