Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Gentoo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-26-2008, 04:08 PM
Mark Hobley
 
Posts: n/a
New telnetd installation produces error: login: Permission Denied

I am trying to configure the telnetd service daemon on Gentoo.

I first installed the internet superserver daemon:

emerge netkit-base

I next installed the telnetd server daemon:

emerge netkit-telnetd

I next created a user and group for the telnetd server daemon:

groupadd -g 300 telnetd
useradd -u 300 -g 300 telnetd

I now modified the telnetd account in /etc/passwd as follows:

telnetd:x:300:300::/nonexistent:/bin/false

(This line is copied from a working telnet server)

Then I created the /etc/inetd.conf configuration file for the internet
superservice daemon with the following entry:

telnet stream tcp nowait telnetd /usr/sbin/telnetd

Next I start the internet superserver daemon as follows:

/etc/init.d/inetd start
* Starting inetd ...

Now I telnet the localhost:

telnet localhost
Trying 127.0.0.1 ...
Connected to localhost.localdomain.
Escape character is ']'

Linux 2.6.23.9 (despina.markhobley.yi.org) (1)
login: Permission Denied.
Connection closed by foreign host.


The error at the login prompt appears before I type in the username, so
I think the error is related somehow to the login program.

I presume that the login: prompt is being generated by the login
program, and then the program is exiting before user input can be
collected, so I suspect the login program was running, but I don't know
for sure. I guess that somehow I have to make a configuration
change to allow the login program to be used from the telnet virtual
terminal. (Then again, I might be wrong.)

Thanks in advance to anyone who can help with this.

Mark.

--
Mark Hobley,
393 Quinton Road West,
Quinton, BIRMINGHAM.
B32 1QE.
Reply With Quote
  #2 (permalink)  
Old 01-26-2008, 07:14 PM
The Natural Philosopher
 
Posts: n/a
Re: New telnetd installation produces error: login: Permission Denied

Mark Hobley wrote:
> I am trying to configure the telnetd service daemon on Gentoo.
>
> I first installed the internet superserver daemon:
>
> emerge netkit-base
>
> I next installed the telnetd server daemon:
>
> emerge netkit-telnetd
>
> I next created a user and group for the telnetd server daemon:
>
> groupadd -g 300 telnetd
> useradd -u 300 -g 300 telnetd
>
> I now modified the telnetd account in /etc/passwd as follows:
>
> telnetd:x:300:300::/nonexistent:/bin/false
>
> (This line is copied from a working telnet server)
>
> Then I created the /etc/inetd.conf configuration file for the internet
> superservice daemon with the following entry:
>
> telnet stream tcp nowait telnetd /usr/sbin/telnetd


Mine says

telnet stream tcp nowait telnetd.telnetd /usr/sbin/tcpd
/usr/sbin/in.telnetd


>
> Next I start the internet superserver daemon as follows:
>
> /etc/init.d/inetd start
> * Starting inetd ...
>
> Now I telnet the localhost:
>
> telnet localhost
> Trying 127.0.0.1 ...
> Connected to localhost.localdomain.
> Escape character is ']'
>


Thats the telnetd working then..at some level

> Linux 2.6.23.9 (despina.markhobley.yi.org) (1)
> login: Permission Denied.
> Connection closed by foreign host.
>


Thats login crapping out. Permissions of some sort.

..

>
> The error at the login prompt appears before I type in the username, so
> I think the error is related somehow to the login program.
>


So do I.

> I presume that the login: prompt is being generated by the login
> program, and then the program is exiting before user input can be
> collected, so I suspect the login program was running, but I don't know
> for sure. I guess that somehow I have to make a configuration
> change to allow the login program to be used from the telnet virtual
> terminal. (Then again, I might be wrong.)
>


Never had a problem.


If you can get a root prompt do an:

su - telnetd

And then try :

/bin/login

Thats is close to the permissions it will be running at

Likewise, look in the log files.



> Thanks in advance to anyone who can help with this.
>
> Mark.
>

Reply With Quote
  #3 (permalink)  
Old 01-26-2008, 07:55 PM
J.O. Aho
 
Posts: n/a
Re: New telnetd installation produces error: login: Permission Denied

Mark Hobley wrote:

> Then I created the /etc/inetd.conf configuration file for the internet
> superservice daemon with the following entry:
>
> telnet stream tcp nowait telnetd /usr/sbin/telnetd
>
> Next I start the internet superserver daemon as follows:


Why not use the xinted instead?
or why not use ssh?


> Now I telnet the localhost:
>
> telnet localhost
> Trying 127.0.0.1 ...
> Connected to localhost.localdomain.
> Escape character is ']'
> Linux 2.6.23.9 (despina.markhobley.yi.org) (1)
> login: Permission Denied.
> Connection closed by foreign host.
> The error at the login prompt appears before I type in the username, so
> I think the error is related somehow to the login program.


What do you get in the messages log file?


--

//Aho
Reply With Quote
  #4 (permalink)  
Old 01-26-2008, 11:08 PM
Mark Hobley
 
Posts: n/a
Re: New telnetd installation produces error: login: Permission Denied

In alt.os.linux.gentoo J.O. Aho <user@example.net> wrote:

> Why not use the xinted instead?


I prefer inetd, it is less resource intesive, and I am using it on all
of my other stations. I try and use the same software across all
stations, where possible.

> or why not use ssh?


The ssh tool encrypts the network traffic making it difficult to
analyse. I don't want encrypted traffic on the local area network.

> What do you get in the messages log file?


This is a new installation, and the system logging mechanisms are not
yet operational. I was hoping to fix this after fixing the remote
access via telnet. I am new to Gentoo, so I am still learning how to
configure it. I am currently working on getting the system loggine
mechanisms operational.

Mark.

--
Mark Hobley,
393 Quinton Road West,
Quinton, BIRMINGHAM.
B32 1QE.
Reply With Quote
  #5 (permalink)  
Old 01-27-2008, 04:23 PM
Dances With Crows
 
Posts: n/a
Re: New telnetd installation produces error: login: Permission Denied

["Followup-To:" header set to comp.os.linux.misc.]
Mark Hobley staggered into the Black Sun and said:
> In alt.os.linux.gentoo J.O. Aho <user@example.net> wrote:
>> Why not use the xinted instead?

> I prefer inetd, it is less resource intesive, and I am using it on all
> of my other stations. I try and use the same software across all
> stations, where possible.
>> or why not use ssh?

> The ssh tool encrypts the network traffic making it difficult to
> analyse. I don't want encrypted traffic on the local area network.


Um... why would you need to analyze this traffic? Also, ssh, when set
up properly, is more *convenient* than telnet. Don't forget ssh's X11
forwarding capabilities, necessary since most modern X installs are
started with '-nolisten tcp'.

>> What do you get in the messages log file?

> This is a new installation, and the system logging mechanisms are not
> yet operational. I was hoping to fix this after fixing the remote
> access via telnet. I am new to Gentoo, so I am still learning how to
> configure it. I am currently working on getting the system loggine
> mechanisms operational.


Like section 9.a of the Gentoo Handbook says,
emerge syslog-ng
rc-update add syslog-ng default
/etc/init.d/syslog-ng start

....you should've done that or something similar during initial install.
The default syslog-ng config, located in /etc/conf.d/ , should get
you something sensible. Most of the config files for the init scripts
are in /etc/conf.d/ .

--
Sometimes I lie awake at night, and I ask, "Where have I gone wrong?"
Then a voice says to me, "This is going to take more than one night."
Charles M. Schulz (1922 - 2000), Charlie Brown in "Peanuts"
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Reply With Quote
  #6 (permalink)  
Old 01-29-2008, 03:48 AM
jayjwa
 
Posts: n/a
Re: New telnetd installation produces error: login: Permission Denied

markhobley@hotpop.donottypethisbit.com (Mark Hobley) writes:


> I am trying to configure the telnetd service daemon on Gentoo.
>
> I first installed the internet superserver daemon:
>
> emerge netkit-base


There's another telnetd in Gnu's inetutils. That's the one I have
here, if you can't make a go with this one. Plus, I'm not sure the
net-kit one is even being maintained anymore, which might be a security
concern. For that matter, I think inetutils includes an inetd as well.

> I now modified the telnetd account in /etc/passwd as follows:
>
> telnetd:x:300:300::/nonexistent:/bin/false


Some apps crap out with a bogus home directory. That may or may not be
the case here, but I thought I'd mention it.


> telnet localhost
> Trying 127.0.0.1 ...
> Connected to localhost.localdomain.
> Escape character is ']'


inetd's done its part ... looks like telnetd's passed control to login
when it hits trouble.

> Linux 2.6.23.9 (despina.markhobley.yi.org) (1)
> login: Permission Denied.
> Connection closed by foreign host.


Are you sure your telnetd can run as an unpriv. user?


> The error at the login prompt appears before I type in the username, so
> I think the error is related somehow to the login program.
>
> I presume that the login: prompt is being generated by the login
> program, and then the program is exiting before user input can be
> collected, so I suspect the login program was running, but I don't know
> for sure. I guess that somehow I have to make a configuration
> change to allow the login program to be used from the telnet virtual
> terminal. (Then again, I might be wrong.)



I'd test with setting a real path for the home dir., and running as
root. See if it clears up, and decide from there what to do. Also, if
the daemon needs some command line options, make sure those are OK
too, check out the man page. Maybe try to run it stand-alone without
inetd, and get it working like that before putting it under inetd.


--
[** America, the police state **]
Whoooose! What's that noise? Why, it's US citizen's
rights, going down the toilet with Bush flushing.
http://www.wired.com/politics/securi...007/08/wiretap
http://www.hermes-press.com/police_state.htm
http://www.privacyinternational.org/...D=x-347-559597
Reply With Quote
  #7 (permalink)  
Old 01-31-2008, 11:08 PM
Mark Hobley
 
Posts: n/a
Re: New telnetd installation produces error: login: Permission Denied

In alt.os.linux.gentoo Mark Hobley <markhobley@hotpop.donottypethisbit.com> wrote:

> However, I still get the permission denied error, if I run the telnetd
> as user telnetd in inetd.conf


It looks like there might be some sort of bug in the telnetlogin
program.

Why do we use this wrapper, instead of just suid the login program?

(Incidentally, I tried this, but it does not work. I still can't login
if telnetd is non-root.)

I wonder if there is some sort of debugging wrapper that would tell me
where the code fails. I am very inexperienced in debugging C in Linux,
because my background is with Assembly Language and Microsoft Codeview.

Failing that I probably need to insert some sort of "echo" traces into
the code.

Mark.

--
Mark Hobley,
393 Quinton Road West,
Quinton, BIRMINGHAM.
B32 1QE.
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Gentoo


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:28 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109