CLI and OS access help!

I am working on an embedded controller. In its released form, I want to give
a user access to an application which has a command line interface without
giving them access to the operating system. They telnet in and,
automatically, the application comes up. No login would be preferable. I
have no clue on how to accomplish this. A shove in the right direction would
be appreciated.

Thanks,

  • Ricardo

Ricardo wrote:

I am working on an embedded controller. In its released form, I want to give
a user access to an application which has a command line interface without
giving them access to the operating system. They telnet in and,
automatically, the application comes up. No login would be preferable. I
have no clue on how to accomplish this. A shove in the right direction would
be appreciated.

Perhaps someone more knowledgable will have a better suggestion, but I
have accomplished the above by setting the shell for the login user to
be my CLI program. You can edit /etc/passwd, and/or /etc/default/passwd
as necessary.

lew

“Lewis Donzis” <lew@nospam.donzis.com> wrote in message
news:3DA2940F.9D0C2066@nospam.donzis.com

Ricardo wrote:
I am working on an embedded controller. In its released form, I want to
give
a user access to an application which has a command line interface
without
giving them access to the operating system. They telnet in and,
automatically, the application comes up. No login would be preferable. I
have no clue on how to accomplish this. A shove in the right direction
would
be appreciated.

Perhaps someone more knowledgable will have a better suggestion, but I
have accomplished the above by setting the shell for the login user to
be my CLI program. You can edit /etc/passwd, and/or /etc/default/passwd
as necessary.

lew

Simple… but elegant. I like it! It might be all I need. Thanks!

  • Ricardo

Ricardo wrote:

Simple… but elegant. I like it! It might be all I need. Thanks!

Oops, I just noticed your desire to skip login, though, and I don’t know
how to keep telnetd from running login as QNX doesn’t appear to have the
typical config files for controlling this.

One option would be to replace the login command with your CLI program.
The thing is, this would also affect the console, but if you don’t mind
also bypassing login on the console, you could edit /etc/config/ttys to
run /bin/sh instead of login and the console would come up in the shell
without running login. Alternatively, if you want your CLI running on
the console too, then leave that file alone.

lew

Replace the login executable with a link to the esh util:
rm /bin/login
ln -s /bin/esh /bin/login

Then when you telnet into the box, you will get a shell prompt without
the login. You can also create a “/etc/esh” script that will get
invoked by “esh” during init.

Ricardo <ricardo.fsi@attbi.com> wrote:

I am working on an embedded controller. In its released form, I want to give
a user access to an application which has a command line interface without
giving them access to the operating system. They telnet in and,
automatically, the application comes up. No login would be preferable. I
have no clue on how to accomplish this. A shove in the right direction would
be appreciated.

Thanks,

  • Ricardo


Kirk Russell Bridlewood Software Testers Guild

Are you using inetd to launch telnetd? If so, there is no need to bother
with all this.

Just edit /etc/inetd.conf and specifiy your application instead of telnetd
on the telnet port. Then when the user tries to telnet to your box, your
application will get started with its standard input and output connected to
the remote user.

Rob Rutherford

“kirk” <kirussel@NOSPAMrogers.com> wrote in message
news:ao3ruq$4u9$1@inn.qnx.com

Replace the login executable with a link to the esh util:
rm /bin/login
ln -s /bin/esh /bin/login

Then when you telnet into the box, you will get a shell prompt without
the login. You can also create a “/etc/esh” script that will get
invoked by “esh” during init.

Ricardo <> ricardo.fsi@attbi.com> > wrote:
I am working on an embedded controller. In its released form, I want to
give
a user access to an application which has a command line interface
without
giving them access to the operating system. They telnet in and,
automatically, the application comes up. No login would be preferable. I
have no clue on how to accomplish this. A shove in the right direction
would
be appreciated.

Thanks,

  • Ricardo


Kirk Russell Bridlewood Software Testers Guild

Robert Rutherford <ruzz@nospamplease.ruzz.com> wrote:

Are you using inetd to launch telnetd? If so, there is no need to bother
with all this.

Just edit /etc/inetd.conf and specifiy your application instead of telnetd
on the telnet port. Then when the user tries to telnet to your box, your
application will get started with its standard input and output connected to
the remote user.

That depends if you application requires a terminal device or not. If
not, then is should work. If so, then you will get strange behaviour
with your cli. YMMV.

Rob Rutherford

“kirk” <> kirussel@NOSPAMrogers.com> > wrote in message
news:ao3ruq$4u9$> 1@inn.qnx.com> …

Replace the login executable with a link to the esh util:
rm /bin/login
ln -s /bin/esh /bin/login

Then when you telnet into the box, you will get a shell prompt without
the login. You can also create a “/etc/esh” script that will get
invoked by “esh” during init.

Doesn’t the telnet client that you are running try to do some handshaking
with the telnetd on the other end?

“Robert Rutherford” <ruzz@NoSpamPlease.ruzz.com> wrote in message
news:ao59pk$o1h$1@inn.qnx.com

Are you using inetd to launch telnetd? If so, there is no need to bother
with all this.

Just edit /etc/inetd.conf and specifiy your application instead of telnetd
on the telnet port. Then when the user tries to telnet to your box, your
application will get started with its standard input and output connected
to
the remote user.

Rob Rutherford

“Bill Caroselli (Q-TPS)” <QTPS@EarthLink.net> wrote in message
news:ao76pa$pq$1@inn.qnx.com

Doesn’t the telnet client that you are running try to do some handshaking
with the telnetd on the other end?

Not really. If you look at RFC 854 (e.g.
http://www.faqs.org/rfcs/rfc854.html ) you will see that while there is a
bunch of optional processing (for option negotiation etc), and some
strangeness in the way that CR is handled (CR NUL etc), in most cases it
will “just work”.

For example, “telnet localhost echo” will do as you expect, as will “telnet
localhost daytime” or “telnet localhost netstat” (or on QN6 “telnet
localhost pidin”).

We use this quite often for diagnostics.

Of course the point was made by kirk that if your application requires a
terminal device, then you probably want a pseudo-terminal (pty) which is
kindly provided for you by telnetd.

Robert

“Robert Rutherford” <> ruzz@NoSpamPlease.ruzz.com> > wrote in message
news:ao59pk$o1h$> 1@inn.qnx.com> …
Are you using inetd to launch telnetd? If so, there is no need to bother
with all this.

Just edit /etc/inetd.conf and specifiy your application instead of
telnetd
on the telnet port. Then when the user tries to telnet to your box, your
application will get started with its standard input and output
connected
to
the remote user.

Rob Rutherford