Re: How to change Telnet Prelogin message?

2003-02-10 Thread Matthew Seaman
On Thu, Feb 06, 2003 at 02:59:54PM -0800, Nathan Kinkade wrote:
> On Thu, Feb 06, 2003 at 10:34:53PM +, Matthew Seaman wrote:
> > On Thu, Feb 06, 2003 at 01:55:12PM -0800, Nathan Kinkade wrote:
> > > On Thu, Feb 06, 2003 at 07:47:16PM +, Matthew Seaman wrote:
> > 
> > > > Interesting.  The source code seems pretty clear in that it only looks
> > > > at the 'im' property:
> > 
> > > > Looks like it's time to send-pr.
> > 
> > > Thanks Matthew.  I did a bit of searching and couldn't find this problem
> > > mentioned anywhere else.  I have submitted a PR with id "docs/48018".
> > 
> > Ah.  Beat me to it.  I'm just working up a patch to telnetd to make it
> > work the way the manual says.  Just testing now before I submit it.
> > 
> 
> Oh no, I didn't submit a patch!  I just pointed to issue out, suggesting
> that someone may like to remove the incorrect text from the telnetd(8)
> manpage, or possibly update the telnetd sources to match the manpage.
> By all means, please do submit a patch!  I do a good bit of work with
> PHP, but I've never programmed with C, so I didn't even think about
> trying to patch.  Thanks for all of your help on this issue.  This was
> the first PR that I have ever submitted, maybe I shouldn't have
> submitted the PR at all if I didn't have the capability to fix the
> problem.  Is there any way that you can send in a patch relating to the
> PR that I already submitted.

Hmmm... Having spent some time looking at this over the weekend, I've
come to the conclusion that adding support for having telnetd display
the /etc/issue file before prompting for a login is impractical when
combined with the SRA encryption used in FreeBSDs standard telnet
setup.  It's certainly beyond my extremely rusty C programming skills.

Furthermore, the display of the IM gettytab property is somewhat
dubious as well:

Consider this entry in the standard /etc/gettytab:

default:\
:cb:ce:ck:lc:fd#1000:im=\r\n%s/%m (%h) (%t)\r\n\r\n:sp#1200:\
 ^^
:if=/etc/issue:

which means you should see a banner like:

FreeBSD/i386 (hostname.example.com) (ttyp0)

when you attempt to log in either via telnet or on the console.
However, it's conspicuously absent *before* the login prompt in a
FreeBSD to FreeBSD telnet sesssion:

% telnet localhost
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Trying SRA secure login:
User (matthew): 
Password: 
[ SRA accepts you ]

FreeBSD/i386 (happy-idiot-talk.infracaninophi) (ttyp4)


Those 'User' and 'Password' prompts originate from the client machine,
and occur as a necessary pre-requisite before the encrypted channel
between the client and server can be set up.  So you've got to log in
before you can see any pre-login messages.

I'm not sure what would appear given an older telnet client that
doesn't support encryption, not having any older telnet clients around
to test with.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: How to change Telnet Prelogin message?

2003-02-06 Thread Nathan Kinkade
On Thu, Feb 06, 2003 at 10:34:53PM +, Matthew Seaman wrote:
> On Thu, Feb 06, 2003 at 01:55:12PM -0800, Nathan Kinkade wrote:
> > On Thu, Feb 06, 2003 at 07:47:16PM +, Matthew Seaman wrote:
> 
> > > Interesting.  The source code seems pretty clear in that it only looks
> > > at the 'im' property:
> 
> > > Looks like it's time to send-pr.
> 
> > Thanks Matthew.  I did a bit of searching and couldn't find this problem
> > mentioned anywhere else.  I have submitted a PR with id "docs/48018".
> 
> Ah.  Beat me to it.  I'm just working up a patch to telnetd to make it
> work the way the manual says.  Just testing now before I submit it.
> 
>   Cheers,
> 
>   Matthew

Oh no, I didn't submit a patch!  I just pointed to issue out, suggesting
that someone may like to remove the incorrect text from the telnetd(8)
manpage, or possibly update the telnetd sources to match the manpage.
By all means, please do submit a patch!  I do a good bit of work with
PHP, but I've never programmed with C, so I didn't even think about
trying to patch.  Thanks for all of your help on this issue.  This was
the first PR that I have ever submitted, maybe I shouldn't have
submitted the PR at all if I didn't have the capability to fix the
problem.  Is there any way that you can send in a patch relating to the
PR that I already submitted.

Thanks,
Nathan

-- 
GPG Public Key ID: 0x4250A04C
gpg --keyserver pgp.mit.edu --recv-keys 4250A04C
http://63.105.21.156/gpg_nkinkade_4250A04C.asc



msg18319/pgp0.pgp
Description: PGP signature


Re: How to change Telnet Prelogin message?

2003-02-06 Thread Matthew Seaman
On Thu, Feb 06, 2003 at 01:55:12PM -0800, Nathan Kinkade wrote:
> On Thu, Feb 06, 2003 at 07:47:16PM +, Matthew Seaman wrote:

> > Interesting.  The source code seems pretty clear in that it only looks
> > at the 'im' property:

> > Looks like it's time to send-pr.

> Thanks Matthew.  I did a bit of searching and couldn't find this problem
> mentioned anywhere else.  I have submitted a PR with id "docs/48018".

Ah.  Beat me to it.  I'm just working up a patch to telnetd to make it
work the way the manual says.  Just testing now before I submit it.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: How to change Telnet Prelogin message?

2003-02-06 Thread Nathan Kinkade
On Thu, Feb 06, 2003 at 07:47:16PM +, Matthew Seaman wrote:
> On Thu, Feb 06, 2003 at 11:23:21AM -0800, Nathan Kinkade wrote:
> > I guess I wasn't paying close enough attention to the original posters
> > question.  I somehow missed the "pre".  In any case, all this has
> > prompted me to play around with pre-login messages.  Using gettytab I
> > can alter the pre-login message for telnet sessions by changing the 'im'
> > capability in gettytab, but for the life of me I can't seem to get
> > telnetd to recognize the 'if' capability.  The console responds to both,
> > but telnetd seems to ignore 'if'.  The perms on /etc/issue are 644.  I
> > don't run inetd, but just for experiment I uncommented telnetd and
> > launched and inetd for testing.  Can anyone explain why telnetd might
> > ignore the 'if' capability specified in the 'default' heading of
> > gettytab?  The telnetd man page clearly states that if 'if' is present
> > it will override 'im'.
> 
> Interesting.  The source code seems pretty clear in that it only looks
> at the 'im' property:
> 
>  .../src/libexec/telnetd/telnetd.c at about line 770
> 
> /*
>  * Show banner that getty never gave.
>  *
>  * We put the banner in the pty input buffer.  This way, it
>  * gets carriage return null processing, etc., just like all
>  * other pty --> client data.
>  */
> 
> if (getent(defent, "default") == 1) {
> char *cp=defstrs;
> 
> HE = Getstr("he", &cp);
> HN = Getstr("hn", &cp);
> IM = Getstr("im", &cp);
> if (HN && *HN)
> (void) strlcpy(host_name, HN, sizeof(host_name));
> if (IM == 0)
> IM = strdup("");
> } else {
> IM = strdup(DEFAULT_IM);
> HE = 0;
> }
> 
> Looks like it's time to send-pr.
> 
>   Cheers,
> 
>   Matthew

Thanks Matthew.  I did a bit of searching and couldn't find this problem
mentioned anywhere else.  I have submitted a PR with id "docs/48018".

Nathan

-- 
GPG Public Key ID: 0x4250A04C
gpg --keyserver pgp.mit.edu --recv-keys 4250A04C
http://63.105.21.156/gpg_nkinkade_4250A04C.asc



msg18307/pgp0.pgp
Description: PGP signature


Re: How to change Telnet Prelogin message?

2003-02-06 Thread Matthew Seaman
On Thu, Feb 06, 2003 at 11:23:21AM -0800, Nathan Kinkade wrote:
> I guess I wasn't paying close enough attention to the original posters
> question.  I somehow missed the "pre".  In any case, all this has
> prompted me to play around with pre-login messages.  Using gettytab I
> can alter the pre-login message for telnet sessions by changing the 'im'
> capability in gettytab, but for the life of me I can't seem to get
> telnetd to recognize the 'if' capability.  The console responds to both,
> but telnetd seems to ignore 'if'.  The perms on /etc/issue are 644.  I
> don't run inetd, but just for experiment I uncommented telnetd and
> launched and inetd for testing.  Can anyone explain why telnetd might
> ignore the 'if' capability specified in the 'default' heading of
> gettytab?  The telnetd man page clearly states that if 'if' is present
> it will override 'im'.

Interesting.  The source code seems pretty clear in that it only looks
at the 'im' property:

 .../src/libexec/telnetd/telnetd.c at about line 770

/*
 * Show banner that getty never gave.
 *
 * We put the banner in the pty input buffer.  This way, it
 * gets carriage return null processing, etc., just like all
 * other pty --> client data.
 */

if (getent(defent, "default") == 1) {
char *cp=defstrs;

HE = Getstr("he", &cp);
HN = Getstr("hn", &cp);
IM = Getstr("im", &cp);
if (HN && *HN)
(void) strlcpy(host_name, HN, sizeof(host_name));
if (IM == 0)
IM = strdup("");
} else {
IM = strdup(DEFAULT_IM);
HE = 0;
}

Looks like it's time to send-pr.

Cheers,

Matthew




-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: How to change Telnet Prelogin message?

2003-02-06 Thread Nathan Kinkade
On Thu, Feb 06, 2003 at 09:27:21AM +, Matthew Seaman wrote:
> On Wed, Feb 05, 2003 at 08:45:12PM -0800, Nathan Kinkade wrote:
> > On Wed, Feb 05, 2003 at 11:17:30PM -0500, Michael wrote:
> > > Hey friends,
> > > I got a BBS up as you may know from my previous post, and i need to allow
> > > telnet access. I want a pre login message telling users to please only use
> > > telnet for BBS and to use SSH2 for shell access. FreeBSDdiary.org is down,
> > > and FreeBSD cheat sheets example has a much older GETTYTAB. Im almost
> > > positive you guys can have me hacking this in moments. Pour some knowledge
> > > on me. Thanks.
> > 
> > motd(5)
> 
> Close, but motd is definitely post login.  /etc/issue can be used to
> display a message on the console before the login prompt.  All you
> need do is write some content into the file.  This file should work
> using the standard gettytab(5) file under FreeBSD with both getty(8)
> and telnetd(8), although I haven't tried using it with telnet recently
> myself.  You want to look for use of the 'if' or the 'im' properties
> in gettytab(5).
> 
> The equivalent for sshd(8) is to set the Banner property in
> /etc/ssh/sshd_config, although this only works if you use the SSH2
> protocol.
> 
>   Cheers,
> 
>   Matthew

I guess I wasn't paying close enough attention to the original posters
question.  I somehow missed the "pre".  In any case, all this has
prompted me to play around with pre-login messages.  Using gettytab I
can alter the pre-login message for telnet sessions by changing the 'im'
capability in gettytab, but for the life of me I can't seem to get
telnetd to recognize the 'if' capability.  The console responds to both,
but telnetd seems to ignore 'if'.  The perms on /etc/issue are 644.  I
don't run inetd, but just for experiment I uncommented telnetd and
launched and inetd for testing.  Can anyone explain why telnetd might
ignore the 'if' capability specified in the 'default' heading of
gettytab?  The telnetd man page clearly states that if 'if' is present
it will override 'im'.

Thanks,
Nathan

-- 
GPG Public Key ID: 0x4250A04C
gpg --keyserver pgp.mit.edu --recv-keys 4250A04C
http://63.105.21.156/gpg_nkinkade_4250A04C.asc



msg18282/pgp0.pgp
Description: PGP signature


Re: How to change Telnet Prelogin message?

2003-02-06 Thread Matthew Seaman
On Wed, Feb 05, 2003 at 08:45:12PM -0800, Nathan Kinkade wrote:
> On Wed, Feb 05, 2003 at 11:17:30PM -0500, Michael wrote:
> > Hey friends,
> > I got a BBS up as you may know from my previous post, and i need to allow
> > telnet access. I want a pre login message telling users to please only use
> > telnet for BBS and to use SSH2 for shell access. FreeBSDdiary.org is down,
> > and FreeBSD cheat sheets example has a much older GETTYTAB. Im almost
> > positive you guys can have me hacking this in moments. Pour some knowledge
> > on me. Thanks.
> 
> motd(5)

Close, but motd is definitely post login.  /etc/issue can be used to
display a message on the console before the login prompt.  All you
need do is write some content into the file.  This file should work
using the standard gettytab(5) file under FreeBSD with both getty(8)
and telnetd(8), although I haven't tried using it with telnet recently
myself.  You want to look for use of the 'if' or the 'im' properties
in gettytab(5).

The equivalent for sshd(8) is to set the Banner property in
/etc/ssh/sshd_config, although this only works if you use the SSH2
protocol.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: How to change Telnet Prelogin message?

2003-02-05 Thread Nathan Kinkade
On Wed, Feb 05, 2003 at 11:17:30PM -0500, Michael wrote:
> Hey friends,
> I got a BBS up as you may know from my previous post, and i need to allow
> telnet access. I want a pre login message telling users to please only use
> telnet for BBS and to use SSH2 for shell access. FreeBSDdiary.org is down,
> and FreeBSD cheat sheets example has a much older GETTYTAB. Im almost
> positive you guys can have me hacking this in moments. Pour some knowledge
> on me. Thanks.

motd(5)

Nathan

-- 
GPG Public Key ID: 0x4250A04C
gpg --keyserver pgp.mit.edu --recv-keys 4250A04C
http://63.105.21.156/gpg_nkinkade_4250A04C.asc



msg18198/pgp0.pgp
Description: PGP signature


How to change Telnet Prelogin message?

2003-02-05 Thread Michael
Hey friends,
I got a BBS up as you may know from my previous post, and i need to allow
telnet access. I want a pre login message telling users to please only use
telnet for BBS and to use SSH2 for shell access. FreeBSDdiary.org is down,
and FreeBSD cheat sheets example has a much older GETTYTAB. Im almost
positive you guys can have me hacking this in moments. Pour some knowledge
on me. Thanks.

-- 
Independent WWW/FreeBSD/Linux/Unix consultant, email me for more information.

Founder/WebMaster/ The unixhideout network
http://www.unixhideout.com
[EMAIL PROTECTED]



-
Free, secure and stable email from UnixHideout
   "The UnixHideout network"
http://www.unixhideout.com/



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message