LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   telnet login (https://www.linuxquestions.org/questions/linux-newbie-8/telnet-login-775757/)

vinaytp 12-15-2009 04:50 AM

telnet login
 
Hi all...

I am trying to login to remote server through telnet....

Code:

[vinay@localhost webhuddle]$ telnet 172.21.109.60
Trying 172.21.108.65...
Connected to 172.21.108.65.
Escape character is '^]'.

linux login: root
Password:
You have new mail in /var/mail/root.
Last login: Tue Dec 15 04:13:08 from 172.17.70.143
linux:~ #

Is there any way to remove the blank line which is coming after Escape character is '^]'.

I commented line in /etc/issue.net
Code:

#Welcome to SUSE LINUX Enterprise Server 9 (i586) - Kernel %r (%t).
Earlier I was getting this message also..Now i am not getting this message...This is fine..But how to remove the blank line after Escape character is '^]'.

Thanks in advance.....

centosboy 12-15-2009 05:39 AM

Quote:

Originally Posted by vinaytp (Post 3792087)
Hi all...

I am trying to login to remote server through telnet....

Code:

[vinay@localhost webhuddle]$ telnet 172.21.109.60
Trying 172.21.108.65...
Connected to 172.21.108.65.
Escape character is '^]'.

linux login: root
Password:
You have new mail in /var/mail/root.
Last login: Tue Dec 15 04:13:08 from 172.17.70.143
linux:~ #

Is there any way to remove the blank line which is coming after Escape character is '^]'.

I commented line in /etc/issue.net
Code:

#Welcome to SUSE LINUX Enterprise Server 9 (i586) - Kernel %r (%t).


Earlier I was getting this message also..Now i am not getting this message...This is fine..But how to remove the blank line after Escape character is '^]'.

Thanks in advance.....


You have blank lines under the welcome message. Remove them...

vinaytp 12-15-2009 06:36 AM

Quote:

Originally Posted by centosboy (Post 3792125)
You have blank lines under the welcome message. Remove them...

No.. I dont have any blank lines..
vim /etc/issue.net
Code:

#Welcome to SUSE LINUX Enterprise Server 9 (i586) - Kernel %r (%t).
~
~

I am struggling ...please help me....

vinaytp 12-15-2009 07:50 AM

Is it possible to remove the blank line above linux login: root
?

Can anyone suggest about this...

centosboy 12-15-2009 08:29 AM

Quote:

Originally Posted by vinaytp (Post 3792239)
Is it possible to remove the blank line above linux login: root
?

Can anyone suggest about this...

are you using a .telnetrc file anywhere?

vinaytp 12-15-2009 08:38 AM

Quote:

Originally Posted by centosboy (Post 3792265)
are you using a .telnetrc file anywhere?

Thanks for your replys centosboy...

I am not using .telnetrc file anywhere..I have to get rid of the blank line which is getting printed ?

centosboy 12-15-2009 08:45 AM

Quote:

Originally Posted by vinaytp (Post 3792270)
Thanks for your replys centosboy...

I am not using .telnetrc file anywhere..I have to get rid of the blank line which is getting printed ?

im not sure...
have you tried completely blanking out /etc/issue.net?
i cant really test this now as im not in front of a suse machine. maybe if you have not got it sorted by the time i get home i can check it...

repo 12-15-2009 08:47 AM

Make sure there is no Carrier return at the beginning of
/etc/issue.net

Code:

cannabis:/home/repo# cat /etc/issue.net
Debian GNU/Linux squeeze/sid
cannabis:/home/repo# telnet 127.0.0.1
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Debian GNU/Linux squeeze/sid
cannabis login: Connection closed by foreign host.

cannabis:/home/repo# cat /etc/issue.net

Debian GNU/Linux squeeze/sid
cannabis:/home/repo# telnet 127.0.0.1
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

Debian GNU/Linux squeeze/sid
cannabis login: Connection closed by foreign host.
cannabis:/home/repo#

BTW, you should use ssh instead of telnet

centosboy 12-15-2009 08:51 AM

Quote:

Originally Posted by repo (Post 3792281)
Make sure there is no Carrier return at the beginning of
/etc/issue.net

Code:

cannabis:/home/repo# cat /etc/issue.net
Debian GNU/Linux squeeze/sid
cannabis:/home/repo# telnet 127.0.0.1
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Debian GNU/Linux squeeze/sid
cannabis login: Connection closed by foreign host.

cannabis:/home/repo# cat /etc/issue.net

Debian GNU/Linux squeeze/sid
cannabis:/home/repo# telnet 127.0.0.1
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

Debian GNU/Linux squeeze/sid
cannabis login: Connection closed by foreign host.
cannabis:/home/repo#

BTW, you should use ssh instead of telnet

Code:

cannabis:/home/repo# cat /etc/issue.net
:)

vinaytp 12-15-2009 09:17 AM

Quote:

Originally Posted by centosboy (Post 3792285)
Code:

cannabis:/home/repo# cat /etc/issue.net
:)

Thanks Centosboy for your reply....

I found \n at the end of line
Code:

linux:~ # od -tc /etc/issue.net
0000000  #  W  e  l  c  o  m  e      t  o      S  U  S  E
0000020      L  I  N  U  X      E  n  t  e  r  p  r  i  s
0000040  e      S  e  r  v  e  r      9      (  i  5  8  6
0000060  )      -      K  e  r  n  e  l      %  r      (  %
0000100  t  )  \n
0000103

But i removed \n using

Code:

tr -d '\012'  < /etc/issue.net > test.txt
cp test.txt issue.net

Now \n got removed form end, But issue remains the same...

Whereas, it works when there is no # at the beggining of the line /etc/issues.net like
Code:

linux:~ # od -tc /etc/issue.net
0000000  W  e  l  c  o  m  e      t  o      S  U  S  E   
0000020  L  I  N  U  X      E  n  t  e  r  p  r  i  s  e
0000040      S  e  r  v  e  r      9      (  i  5  8  6  )
0000060      -      K  e  r  n  e  l      \  r      (  \  l
0000100  )  .  \n
0000103
linux:~ #

And i removed \n in the same way as is did before...
This time it is working, but Message Welcome to SUSE LINUX Enterprise Server 9 (i586) - Kernel \r (\l).
is printing since hash is removed, My requirement is not to print message and blank line...Simultaneously both are not working....

Hope you help me with this...Thanks once again...

Waiting with anticipation.....

centosboy 12-15-2009 09:21 AM

Quote:

Originally Posted by vinaytp (Post 3792319)
Thanks Centosboy for your reply....

I found \n at the end of line
Code:

linux:~ # od -tc /etc/issue.net
0000000  #  W  e  l  c  o  m  e      t  o      S  U  S  E
0000020      L  I  N  U  X      E  n  t  e  r  p  r  i  s
0000040  e      S  e  r  v  e  r      9      (  i  5  8  6
0000060  )      -      K  e  r  n  e  l      %  r      (  %
0000100  t  )  \n
0000103

But i removed \n using

Code:

tr -d '\012'  < /etc/issue.net > test.txt
cp test.txt issue.net

Now \n got removed form end, But issue remains the same...

Whereas, it works when there is no # at the beggining of the line /etc/issues.net like
Code:

linux:~ # od -tc /etc/issue.net
0000000  W  e  l  c  o  m  e      t  o      S  U  S  E   
0000020  L  I  N  U  X      E  n  t  e  r  p  r  i  s  e
0000040      S  e  r  v  e  r      9      (  i  5  8  6  )
0000060      -      K  e  r  n  e  l      \  r      (  \  l
0000100  )  .  \n
0000103
linux:~ #

And i removed \n in the same way as is did before...
This time it is working, but Message Welcome to SUSE LINUX Enterprise Server 9 (i586) - Kernel \r (\l).
is printing since hash is removed, My requirement is not to print message and blank line...Simultaneously both are not working....

Hope you help me with this...Thanks once again...

Waiting with anticipation.....

this is not the best solution...but can you try with issue.net completely empty?? just back up the original..

vinaytp 12-15-2009 09:23 AM

Quote:

Originally Posted by repo (Post 3792281)
Make sure there is no Carrier return at the beginning of
/etc/issue.net

Code:

cannabis:/home/repo# cat /etc/issue.net
Debian GNU/Linux squeeze/sid
cannabis:/home/repo# telnet 127.0.0.1
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Debian GNU/Linux squeeze/sid
cannabis login: Connection closed by foreign host.

cannabis:/home/repo# cat /etc/issue.net

Debian GNU/Linux squeeze/sid
cannabis:/home/repo# telnet 127.0.0.1
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

Debian GNU/Linux squeeze/sid
cannabis login: Connection closed by foreign host.
cannabis:/home/repo#

BTW, you should use ssh instead of telnet

Dear repo,

Thanks for suggestion...

In your case it is working fine because it is printing some message when you login, please try to comment contents of /etc/issue.net and try...I hope it will give a blank line even if you remove \n at the end..

repo 12-15-2009 09:27 AM

Quote:

In your case it is working fine because it is printing some message when you login, please try to comment contents of /etc/issue.net and try...I hope it will give a blank line even if you remove \n at the end..
with comment contents of /etc/issue.net

Quote:

cannabis:/home/repo# cat /etc/issue.net
#Debian GNU/Linux squeeze/sid
cannabis:/home/repo# telnet 127.0.0.1
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
cannabis login: ^CConnection closed by foreign host.
cannabis:/home/repo#

vinaytp 12-15-2009 09:29 AM

Quote:

Originally Posted by centosboy (Post 3792324)
this is not the best solution...but can you try with issue.net completely empty?? just back up the original..

Dear Centosboy,

I have not got the solution yet...I dont want to print either message or blank line

I have tried by making the file empty...It doesn't work...same blank line will appear..

Finally I removed /etd/issue.net and i tried
Code:

[vinay@localhost webhuddle]$ telnet 172.21.109.60
Trying 172.21.109.60...
Connected to 172.21.109.60.
Escape character is '^]'.

Linux 2.6.5-7.97-default (linux) (4)


linux login:

I dont know from where the message Linux 2.6.5-7.97-default (linux) (4)is coming ?

Any help ?

centosboy 12-15-2009 09:30 AM

Quote:

Originally Posted by vinaytp (Post 3792343)
Dear Centosboy,

I have not got the solution yet...I dont want to print either message or blank line

I have tried by making the file empty...It doesn't work...same blank line will appear..

Finally I removed /etd/issue.net and i tried
Code:

[vinay@localhost webhuddle]$ telnet 172.21.109.60
Trying 172.21.109.60...
Connected to 172.21.109.60.
Escape character is '^]'.

Linux 2.6.5-7.97-default (linux) (4)


linux login:

I dont know from where the message Linux 2.6.5-7.97-default (linux) (4)is coming ?

Any help ?

/etc/issue?

like i said i cant really test as no suse...but im sure it cant be that much different from centos?


All times are GMT -5. The time now is 09:43 AM.