public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] ssh defaults to coming in as user "root"?
@ 2020-07-10 23:08 Walter Dnes
  2020-07-10 23:37 ` Jack
  0 siblings, 1 reply; 10+ messages in thread
From: Walter Dnes @ 2020-07-10 23:08 UTC (permalink / raw
  To: Gentoo Users List

  I've done the preliminary setup on my laptop install, and copied the
package names I wanted into the world file.  With dependancies thrown
in, the laptop is now compiling 268 ebuilds of various sizes.

  One thing I noticed while setting up.  I ssh in from my desktop PC to
the Thinkpad laptop (named "thimk" <G>) to set things up.  The default
seems to be to come in to the root account, unless I override.  User
"waltdnes" on my desktop does not default to coming in as user
"waltdnes" on my laptop.  I have to specify a non-root user.  See below.

[i660][waltdnes][~] ssh thimk
[thimk][root][~]

[i660][waltdnes][~] ssh waltdnes@thimk
[thimk][waltdnes][~]

  Is this a recent change?

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] ssh defaults to coming in as user "root"?
  2020-07-10 23:08 [gentoo-user] ssh defaults to coming in as user "root"? Walter Dnes
@ 2020-07-10 23:37 ` Jack
  2020-07-10 23:49   ` Rich Freeman
  0 siblings, 1 reply; 10+ messages in thread
From: Jack @ 2020-07-10 23:37 UTC (permalink / raw
  To: gentoo-user

On 2020.07.10 19:08, Walter Dnes wrote:
>   I've done the preliminary setup on my laptop install, and copied the
> package names I wanted into the world file.  With dependancies thrown
> in, the laptop is now compiling 268 ebuilds of various sizes.
> 
>   One thing I noticed while setting up.  I ssh in from my desktop PC  
> to
> the Thinkpad laptop (named "thimk" <G>) to set things up.  The default
> seems to be to come in to the root account, unless I override.  User
> "waltdnes" on my desktop does not default to coming in as user
> "waltdnes" on my laptop.  I have to specify a non-root user.  See  
> below.
> 
> [i660][waltdnes][~] ssh thimk
> [thimk][root][~]
> 
> [i660][waltdnes][~] ssh waltdnes@thimk
> [thimk][waltdnes][~]
> 
>   Is this a recent change?
Have you tried ssh -v, or even multiple -v's?

What versions?  I've got openssh-8.3_p1-r2, and haven't seen any such  
issues.  I do have a problem where ssh from my laptop (artix linux) to  
my desktop (Gentoo) almost immedaitely closes the connection, but if I  
ssh from laptop to a different laptop or desktop, and then to the  
Gentoo desktop, it works fine.  If it annoys me enough, I'll eventually  
post it here as a new issue.

I'd also check UID's not just names, just in case, although I can't  
think why it would matter.  Is there anything strange in ssh.config or  
sshd.config on either side?  You might compare sshd.config on the two  
boxes.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] ssh defaults to coming in as user "root"?
  2020-07-10 23:37 ` Jack
@ 2020-07-10 23:49   ` Rich Freeman
  2020-07-11  0:36     ` Walter Dnes
  0 siblings, 1 reply; 10+ messages in thread
From: Rich Freeman @ 2020-07-10 23:49 UTC (permalink / raw
  To: gentoo-user

On Fri, Jul 10, 2020 at 7:37 PM Jack <ostroffjh@users.sourceforge.net> wrote:
>
> On 2020.07.10 19:08, Walter Dnes wrote:
> >   I've done the preliminary setup on my laptop install, and copied the
> > package names I wanted into the world file.  With dependancies thrown
> > in, the laptop is now compiling 268 ebuilds of various sizes.
> >
> >   One thing I noticed while setting up.  I ssh in from my desktop PC
> > to
> > the Thinkpad laptop (named "thimk" <G>) to set things up.  The default
> > seems to be to come in to the root account, unless I override.  User
> > "waltdnes" on my desktop does not default to coming in as user
> > "waltdnes" on my laptop.  I have to specify a non-root user.  See
> > below.
> >
> > [i660][waltdnes][~] ssh thimk
> > [thimk][root][~]
> >
> > [i660][waltdnes][~] ssh waltdnes@thimk
> > [thimk][waltdnes][~]
> >
> >   Is this a recent change?
> Have you tried ssh -v, or even multiple -v's?
>
> What versions?  I've got openssh-8.3_p1-r2, and haven't seen any such
> issues.

Keep in mind that the username is set by the CLIENT, not the server,
so that is where the issue lies if it isn't using the username you
want it to.

-- 
Rich


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] ssh defaults to coming in as user "root"?
  2020-07-10 23:49   ` Rich Freeman
@ 2020-07-11  0:36     ` Walter Dnes
  2020-07-11  5:12       ` Grant Taylor
  2020-07-11  5:12       ` Walter Dnes
  0 siblings, 2 replies; 10+ messages in thread
From: Walter Dnes @ 2020-07-11  0:36 UTC (permalink / raw
  To: gentoo-user

On Fri, Jul 10, 2020 at 07:49:37PM -0400, Rich Freeman wrote

> Keep in mind that the username is set by the CLIENT, not the server,
> so that is where the issue lies if it isn't using the username you
> want it to.

  Doing some more googling.  Lots of hits about people who want to log
in as root (opposite of me).  Apparently, you need a .ssh/config file to
force that.  I don't remember ever setting one one up.  But I looked in
.ssh; lo and behold, there it was.  "cat" showed that its contents were

Host thimk
        KexAlgorithms +diffie-hellman-group1-sha1
  User root

  I renamed the file, and behaviour returned to expected behaviour...

[i660][waltdnes][~] ssh thimk
[thimk][waltdnes][~]

  The question is how did .ssh/config ever get there in the first place?

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] ssh defaults to coming in as user "root"?
  2020-07-11  0:36     ` Walter Dnes
@ 2020-07-11  5:12       ` Grant Taylor
  2020-07-11  7:07         ` Neil Bothwick
  2020-07-11  9:28         ` Walter Dnes
  2020-07-11  5:12       ` Walter Dnes
  1 sibling, 2 replies; 10+ messages in thread
From: Grant Taylor @ 2020-07-11  5:12 UTC (permalink / raw
  To: gentoo-user

On 7/10/20 6:36 PM, Walter Dnes wrote:
>    The question is how did .ssh/config ever get there in the first place?

Seeing as how there is a Host entry with your notebook's name, I can 
only speculate that you, or something you ran, put it there.

I find the KeyAlgorithms line to be atypical as well.

Is there a chance that you used a fancy wrapper, possibly menu driven, 
that might have updated the ~/.ssh/config file?



-- 
Grant. . . .
unix || die


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] ssh defaults to coming in as user "root"?
  2020-07-11  0:36     ` Walter Dnes
  2020-07-11  5:12       ` Grant Taylor
@ 2020-07-11  5:12       ` Walter Dnes
  2020-07-11  6:04         ` Grant Taylor
  1 sibling, 1 reply; 10+ messages in thread
From: Walter Dnes @ 2020-07-11  5:12 UTC (permalink / raw
  To: gentoo-user

On Fri, Jul 10, 2020 at 08:36:03PM -0400, Walter Dnes wrote
> 
> The question is how did .ssh/config ever get there in the first place?

  Would the following activity trigger creation of .ssh/config ??

* at the end of the Gentoo minimal install I rebooted
* oops; can't do passwordless ssh in to root (the only account)
* walked over to laptop; tweaked sshd_config to allow root login via
  password (I'm behind a NATting router); and restarted sshd
* ssh into laptop and ran ssh-keygen
* walked back to desktop and pushed .ssh/id_rsa.pub from desktop root
  and waltdnes accounts to .ssh/authorized_keys on laptop
* confirmed that desktop could do passwordless ssh to laptop
* walked over to laptop; tweaked sshd_config to forbid root login via
  password; and restarted sshd

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] ssh defaults to coming in as user "root"?
  2020-07-11  5:12       ` Walter Dnes
@ 2020-07-11  6:04         ` Grant Taylor
  0 siblings, 0 replies; 10+ messages in thread
From: Grant Taylor @ 2020-07-11  6:04 UTC (permalink / raw
  To: gentoo-user

On 7/10/20 11:12 PM, Walter Dnes wrote:
>    Would the following activity trigger creation of .ssh/config ??

If I'm reading your sequence of events properly, no, they should not 
alter your desktop's SSH config to cause it to try to log into the 
notebook as the root user.




-- 
Grant. . . .
unix || die


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] ssh defaults to coming in as user "root"?
  2020-07-11  5:12       ` Grant Taylor
@ 2020-07-11  7:07         ` Neil Bothwick
  2020-07-11 16:27           ` Walter Dnes
  2020-07-11  9:28         ` Walter Dnes
  1 sibling, 1 reply; 10+ messages in thread
From: Neil Bothwick @ 2020-07-11  7:07 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

On Fri, 10 Jul 2020 23:12:37 -0600, Grant Taylor wrote:

> >    The question is how did .ssh/config ever get there in the first
> > place?  
> 
> Seeing as how there is a Host entry with your notebook's name, I can 
> only speculate that you, or something you ran, put it there.
> 
> I find the KeyAlgorithms line to be atypical as well.

There was an update to sshd that caused connections to some older
variants to fail unless you used this, I have it in ssh_config to allow
connections to a DD-WRT router. Is it possible to hit a similar problem
and cut and pasted from a Google hit that also included the User line.


-- 
Neil Bothwick

Those who live by the sword get shot by those who don't.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] ssh defaults to coming in as user "root"?
  2020-07-11  5:12       ` Grant Taylor
  2020-07-11  7:07         ` Neil Bothwick
@ 2020-07-11  9:28         ` Walter Dnes
  1 sibling, 0 replies; 10+ messages in thread
From: Walter Dnes @ 2020-07-11  9:28 UTC (permalink / raw
  To: gentoo-user

On Fri, Jul 10, 2020 at 11:12:37PM -0600, Grant Taylor wrote
> 
> I find the KeyAlgorithms line to be atypical as well.
> 
> Is there a chance that you used a fancy wrapper, possibly menu driven, 
> that might have updated the ~/.ssh/config file?

  Not that I remember.  I've used "thimk" as the name for the Thinkpad
in the past under both Gentoo and Puppy linux.  Puppy is an older
lightweight linux that runs with root as the primary user.  That might
have been enough to have made me dig up the docs to create the config
file, but I certainly don't remember doing so.  To quote the old saying
"Memory is the second thing to go. I forget what the first is".

  Come to think of it, SSHing into "thimk" with Puppy linux would put me
in as root in the past.  I thought this was somehow due to root being the
only user on Puppy linux.  File dates in .ssh are...

* Sep  6, 2018 the former .ssh/config file
* Sep 22, 2018 authorized keys
* May 29, 2017 id_rsa and id_rsa.pub
* Jul  9, 2020 known_hosts

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] ssh defaults to coming in as user "root"?
  2020-07-11  7:07         ` Neil Bothwick
@ 2020-07-11 16:27           ` Walter Dnes
  0 siblings, 0 replies; 10+ messages in thread
From: Walter Dnes @ 2020-07-11 16:27 UTC (permalink / raw
  To: gentoo-user

On Sat, Jul 11, 2020 at 08:07:20AM +0100, Neil Bothwick wrote
> On Fri, 10 Jul 2020 23:12:37 -0600, Grant Taylor wrote:
> 
> > I find the KeyAlgorithms line to be atypical as well.
> 
> There was an update to sshd that caused connections to some older
> variants to fail unless you used this, I have it in ssh_config to allow
> connections to a DD-WRT router. Is it possible to hit a similar problem
> and cut and pasted from a Google hit that also included the User line.

  I was running an older version of Puppy linux on the laptop for a
while, which may have hit the situation you describe.  I'm surprised
mostly that I don't remember doing the config.

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-07-11 16:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-10 23:08 [gentoo-user] ssh defaults to coming in as user "root"? Walter Dnes
2020-07-10 23:37 ` Jack
2020-07-10 23:49   ` Rich Freeman
2020-07-11  0:36     ` Walter Dnes
2020-07-11  5:12       ` Grant Taylor
2020-07-11  7:07         ` Neil Bothwick
2020-07-11 16:27           ` Walter Dnes
2020-07-11  9:28         ` Walter Dnes
2020-07-11  5:12       ` Walter Dnes
2020-07-11  6:04         ` Grant Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox