Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jul 2002 23:21:16 +0100
From:      Daniel Bye <dan@slightlystrange.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Telnetd
Message-ID:  <20020717222115.GF634@catflap.home.slightlystrange.org>
In-Reply-To: <20020717220952.GE21153@freepuppy.bellavista.cz>
References:  <20020717220116.10321.qmail@linuxmail.org> <20020717220952.GE21153@freepuppy.bellavista.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 18, 2002 at 12:09:52AM +0200, Roman Neuhauser wrote:
> > I have a system running telnetd and sshd
> > Some users may NOT use telnet to login, they have to login via sshd
> > (using passwords).
> > 
> > How do I do that?
> 
>     i'm not aware of any method. so, before someone comes with a
>     solution (if there's one), why can't all users use ssh?

Perhaps you can take advantage of the $SSH_TTY variable that gets set
for all ssh logins?  A shell rc file can test for the presence (or
absence, as you prefer) of this variable in the user's evironment and
take the appropriate action (continue, or kill the shell and log the
user off again.)

At least one problem comes to mind, though, in that you would have to 
be quite draconian about ownership and permissions on the rc files,
or users can simply edit or remove them.

Maybe provide a standard one that performs the test, then if the 
session is permitted, make its last action to source another rc file
that the user can edit (called, say, .login.local).  You can then use 
"chflags schg" on the one YOU want control over.

Haven't tried it, though, and it would involve writing variants of
the file for Bourne-style shells and C-style shells.

Then again, there may be more elegant ways of doing it...

Dan 

-- 
Daniel Bye

PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc
PGP Key fingerprint: 3D73 AF47 D448 C5CA 88B4 0DCF 849C 1C33 3C48 2CDC
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020717222115.GF634>