Sim.
No arquivo ~/.ssh/authorized_keys
no servidor, cada entrada agora provavelmente se parece com
ssh-ed25519 AAAAC3NzaC1lZSOMEKEYFINGERPRINT comment
(ou similar)
Existe uma primeira coluna opcional que pode conter opções. Eles estão descritos no manual sshd
.
Uma das opções é
from="pattern-list"
Specifies that in addition to public key authentication, either the canonical name of the remote host or its IP address must be present in the comma-separated list of patterns. See PATTERNS in ssh_config(5) for more information on patterns.
In addition to the wildcard matching that may be applied to hostnames or addresses, a from stanza may match IP addresses using CIDR address/masklen notation.
The purpose of this option is to optionally increase security: public key authentication by itself does not trust the network or name servers or anything (but the key); however, if somebody somehow steals the key, the key permits an intruder to log in from anywhere in the world. This additional option makes using a stolen key more difficult (name servers and/or routers would have to be compromised in addition to just the key).
Isso significa que você deve poder modificar ~/.ssh/authorized_keys
de
ssh-ed25519 AAAAC3NzaC1lZSOMEKEYFINGERPRINT comment
para
from="pattern" ssh-ed25519 AAAAC3NzaC1lZSOMEKEYFINGERPRINT comment
Em que pattern
é um padrão que corresponde ao host do cliente ao qual você está se conectando.