stty settings different between "root" user and other

I have a perl/expect script, that ssh's into my Linode machine: Ubuntu 12.04 64-bit.

I noticed that the stty settings are different between 2 users:

"root" and "other".

This Linode machine is a virgin machine, and I added one "other" user account.

When using this expect/perl script, I do make a call to set the tty settings to raw

on the expect object:

$exp->raw_pty(1);

Then I ssh in to the machine, etc.

When running "stty" via this connection when logged in as "other", I get:

speed 38400 baud; line = 0;

min = 1; time = 0;

-brkint -icrnl -imaxbel

-opost -onlcr

-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

(I'm particularly interested in and happy with the setting of: -icrnl anBut it seems that the "root" account, resets itself.d -echo)

When running "stty" via this connection when logged in as "root", I get:

speed 38400 baud; line = 0;

-brkint -imaxbel

(note the scarcity of many settings)

I can certainly send in a command of stty raw -noecho when ssh-ing in as root

in this perl/expect script to change the stty settings to how they should already be.

So this "root" account's tty settings are setable.

Does anyone know why the "root" account (which is normally disabled on an Ubuntu machine)

ignored the stty settings that the perl/expect script does behind the scenes?

or does anyone know what secret login script that the "root" account sources

that may undo or reset the stty settings?

1 Reply

Note to self:

I have removed perl and expect from the scenario.

In a terminal window on my Linux machine at home, if I first run:

stty raw -echo,

then ssh into the Linode machine as "other", then run stty,

I will see the same settings that were on my local machine.

So the terminal settings that I had prior to ssh were "transferable" or "honoured" by the Linode machine/connection.

But instead, if I ssh into the Linode machine as "root", then run stty,

I don't get the settings that I had on my local machine.

So this confirms that the "root" user on an Ubuntu 12.04 machine does not honor

the stty settings from the ssh connection.

My question remains the same:

What secret login script does the "root" account source

that may undo or reset the stty settings?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct