[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] Telnet as root



On Wed, Jan 12, 2000 at 03:38:19PM +0530, Rakesh Tiwari wrote:
> So now u cant telnet as root on an 6.1 since u get a terminal type
> /dev/pts/0 or 2 or xx.

You can telnet! My previous mail talked about adding 0,1,2 etc. to your
/etc/securetty like so,
0
1
2
for the newer distributions and will be able to login as root.

> This 0, 1 , 2 .xx is generated immediately when u telnet rest of the time
> they are not present
Check your /etc/fstab where the /dev/pts directory entry exists.
> can any one give more details about this new /dev/pts/xx
Read your /usr/src/linux/devices.txt (Search for pts)
Also,
/usr/src/linux/drivers/char/pty.c

> Also does any one know how to edit ur telnet so as to get connected to the
> choice of "tty" u want
The code for the default telnet server searches for the first openable master pseudo terminal with code something like this

char term_name[] = "/dev/ptyp0", *p1;
int master, slave, one=1;

        p1 = &term_name[9];
        for (one = 0; one < 7; one++) {
                master = open(term_name, 2);
                if (master > 0) break;
                (*p1)++;
        }
[ Well, the original code also increments the "ptyp" to "ptyq" and so on... ]
 Therefore, the first free pseudo-terminal is opened. If you wanted the connecting client to be able to select its own terminal, some kind of extra handshaking would be required with changes in both your server and client code.
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.