Bug#983464: openssh-server: Forced command affects all keys

Timo Weingärtner <[email protected]>
Newsgroups gmane.linux.debian.devel.ssh
Message-ID <4789668.DiWh60cFF9__4660.79358463816$1614189988$gmane$org@timo01.tiwe.de>
Hallo Henrik Christian Grove,

24.02.21 17:36 Henrik Christian Grove:
> Package: openssh-server
> Version: 1:8.4p1-4
> Severity: normal
> X-Debbugs-Cc: [email protected]
> 
> (I guess - but haven't checked in any way - that this also affects
> upstream)
> 
> (There are many open bugs against this package, so I didn't carefully
> read the list, but did search it - without finding this issue)
> 
> The sshd manpage says:
>      command="command"
>              Specifies that the command is executed whenever this key is
> used for authentication.
> 
> but when I add such an option on one key in my authorized_keys file, so
> it looks like:
> ssh-rsa AAAAB3... [email protected]
> command="/bin/hostname" ssh-rsa AAAAB3N... [email protected]
> (I've shortened my public keys, as they are completely irrelevant, if
> you want to give me access to some machine, ask me for the complete key)
> 
> I get the output of /bin/hostname no matter which key I use:
> grove@stacey> ssh -i .ssh/privat_rsa 10.0.3.106 date
> sid
> grove@stacey> ssh -i .ssh/id_rsa 10.0.3.106 date
> sid

Which key is accepted by the server? You can see that in either of:
* ssh -v, search for "Server accepts key"
* sshd log, search for "Accepted publickey for"

You may have the "wrong" key in your ssh-agent and you're not using 
"IdentitiesOnly=yes".


Grüße
Timo
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE87+TxUS8xnavTxo5VO6rSJSm4+0FAmA2jfAACgkQVO6rSJSm
4+0O5xAAkrJNqxBClBFXyqrIRg5O77y3Loi2dEXI/MQt893XhctjiUa5NUgLIbqq
TWNF9ag0lK3uqZnHiSpCjBBK+Yh8VHWf4Zaxm3ZroT2zDrObI9RWVxh6EByGTM+U
Uk7QCbx8+Vx+YmtEdVA0ZTtRLLlBoH6ooBM0IGR2BVs258O7JbdZ3OR0mSxZ5n0P
msuoXlXwiIBP+JHJZ+W+s9rBXt2ixcOniMfzbkmhGzKFNOQeodBDeiu/S6R+NtH9
KIkmcD1meoeljJS+HxZyylTFz6L8sk85NmBzIwVBE51MafLcTygiQ7SUgac2ChCS
07AXJPcMGD1hpGWDaHgBhSd/i9XKzQrVfW/8MANSuuI1xoWYKw8pHM9A9OcrfTUc
AuRTJ3/zLUvsEXIft8WLJnlV4IQZD4N2q98H2s/g3W5iF837/VKgYmMcx+o5kFjI
mZDW2A3IJuOVoabGqkWOyNpe51QPi7tBp6idx+5ckE6DqGIthU4qGqx1UDwZR/Pn
nvmrNUgBpfR8IR40Pq1VahJJjE622ke+GoN9s8dizjSBeSJLsQISR/wwfS2haYHY
cvsWwcP2XCObJjPACLO6wQqobS22F7GyFFc8gxL3/r7FGK1xhWqTX16WjZcm6xkA
a65G3y7B7ZIdW5mFbX1h6R8VpDL7Q+BvLsbJVORdcqwkAeVB3sw=
=uabm
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.