Linux – Tie SSH key with MAC address

linuxmac addresssshssh-keys

I have a ubuntu server which I scp files to often. It is setup for password-less authentication using a key I have on the server. Is it possible to tie a mac address to the key so that only my client can login with it?

Best Answer

No.
SSH keys are a public/private key authentication pair. They know nothing of networks1.

Further, the SSH server has no clue what the MAC address of a client is. Its knowledge of the network ends at TCP/IP. There is no reason it would need the MAC address of its clients, and it wouldn't be available for all clients anyway (think about hosts that are not on the local subnet).


1Exception: Host keys are usually associated with the IP address or hostname of the host they belong to, via the known_hosts file -- This association isn't strictly necessary for SSH to function, it's just added security to make sure you're connecting to the machine you think you're connecting to.