# Remote access security

**URL:** <https://talk.tidbits.com/t/remote-access-security/29944>\
**Category:** TidBITS Talk\
**Created:** [January 7, 2025, 12:48am UTC](https://talk.tidbits.com/t/remote-access-security/29944 "2025-01-07T00:48:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shamino](https://talk.tidbits.com/user_avatar/talk.tidbits.com/shamino/32/19200_2.png) [@Shamino](https://talk.tidbits.com/u/Shamino)\
**Post date:** [January 7, 2025, 12:48am UTC](https://talk.tidbits.com/t/remote-access-security/29944/1 "2025-01-07T00:48:16Z")

</div>

Continuing the discussion from [Do You Use It? What’s Your Backup Strategy](https://talk.tidbits.com/t/do-you-use-it-what-s-your-backup-strategy/29939/6):

> [@Do You Use It? What’s Your Backup Strategy](https://talk.tidbits.com/t/do-you-use-it-what-s-your-backup-strategy/29939/6):
>
> I was testing remote login via SSH from work. It worked. When I got home, I checked the logs and found out that someone else had accessed the system and dropped a malware payload into the /Users/Shared directory. The files were not Mac-compatible. Nonetheless, I wiped the drive and restored from a SuperDuper! backup.

From my experience, SSH remote access is pretty secure, but I would never allow a guest-login account to use it. I actually never use guest accounts at all.

To be more secure, I recommend disabling password-based authentication altogether. To do this, edit the SSH daemon’s configuration file, `/etc/ssh/sshd_config`, locate the line:

```
#PasswordAuthentication yes

```

And change it to:

```
PasswordAuthentication no

```

Alternatively, if you don’t want to touch the system-provided SSH daemon config file, you can create a file (any name will do) in the `/etc/ssh/sshd_config.d` directory containing the above “`PasswordAuthentication no`” line.

And then reboot to make the changes take effect. (You might be able to just turn remote-login off, wait a second and turn it on again via system settings.)

Now, nobody can log in via SSH using a password. Of course, if that’s all you do, then nobody can log in at all. The next step is to create a public/private key pair to use for authentication instead of a password. To do this (from a command-line):

1. If it doesn’t already exist, create a `.ssh` directory in your home directory. Make its permissions “700”, so no other users have access (SSH will ignore the directory if its permissions are wrong). Create an authorized-keys file if it is missing, and set its permissions to “600”:

2. Create a public/private key pair if you don’t already have one. The `ssh-keygen` utility can do it:

3. Append your newly-created public key to the authorized-keys file (which you may have just created in step 1):

And the server-side is done. Now, copy your private key (`~/.ssh/id_rsa`) to the computer you want to log-in _from_. Copy it to that computer’s `~/.ssh/` directory (making sure it has all the necessary permissions).

(This is if your client is running OpenSSH, which is typical for most Unix-like systems. Windows clients may have a different mechanism.)

When you try to SSH from the remote host (e.g. `ssh user@hostname` or `slogin user@hostname`), the remote host will use the private key you installed (`~/.ssh/id_rsa`) to authenticate the login against the set of authorized public keys (`~/.ssh/authorized_keys`) in the home directory for the account you’re logging in to.

If your remote host needs to log in to multiple servers that have different key-pairs, copy all the required private keys to the host (with different names, of course) and create a `~/.ssh/config` file that specifies which should be used for each server. For example:

```plaintext
host foo.example.com
    IdentityFile ~/.ssh/id_rsa_foo
host bar.example.com
    User jimbo
    IdentityFile ~/.ssh/id_rsa_bar
host baz
    HostName baz.example.com
    User johnny5
    IdentityFile ~/.ssh/id_rsa_baz

```

The above configuration file has configurations for three remote servers:

- `foo.example.com` authenticates using the private key `id_rsa_foo`
- `bar.example.com` authenticates using the private key `id_rsa_bar`, and will use the user name `jimbo` if you don’t specify one when connecting. (By default, SSH uses your locally-logged-in user name as the remote-login user name.)
- `baz` is an alias so you don’t need to type the full host name (e.g. `ssh baz`). It will try to connect to the host name `baz.example.com` using a default user name of `johnny5` and the private key `id_rsa_baz`.

If you want to log in to different user accounts on the server, repeat the above in each user’s home directory. The `~/.ssh/authorized_keys` file in each user’s home directory will determine which keys are valid for authenticating access to that user account.

If you want to allow multiple people to log in to a single user account, you can create and install multiple key-pairs in that account’s authorized-keys file. Create a pair for each person, and give that person his private key. Don’t give a single private key to more than one person. This way if one person is irresponsible, you can easily delete his public key from the authorized-keys file, cutting off his access.

See also:

- [How to Disable SSH Login With Password](https://linuxhandbook.com/ssh-disable-password-authentication/)
- [How to Add SSH Public Key to Server](https://linuxhandbook.com/add-ssh-public-key-to-server/)
- [Using the SSH Config File](https://linuxize.com/post/using-the-ssh-config-file/)
- `man ssh_config`

---

<div class="post-metadata">

**Author:** ![mpainesyd](https://talk.tidbits.com/user_avatar/talk.tidbits.com/mpainesyd/32/3272_2.png) [@mpainesyd](https://talk.tidbits.com/u/mpainesyd)\
**Post date:** [December 2, 2026, 6:33am UTC](https://talk.tidbits.com/t/remote-access-security/29944/2 "2026-12-02T06:33:41Z")

</div>

An update on cracking RSA (it was mostly hype)🙂

> **[Here’s what you need to know about AI’s potential threat to encryption](https://www.technologyreview.com/2026/11/30/1150115/explain-ai-potential-threat-encryption/)**
>
> Frontier labs may have broken one of the key pillars of cryptography. This is what it could mean.

---

<div class="post-metadata">

**Author:** ![alexandertaylor](https://talk.tidbits.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@alexandertaylor](https://talk.tidbits.com/u/alexandertaylor)\
**Post date:** [December 2, 2026, 6:38am UTC](https://talk.tidbits.com/t/remote-access-security/29944/3 "2026-12-02T06:38:48Z")

</div>

That RSA-cracking story doesn’t change the practical SSH advice much. If you’re setting up keys now, prefer Ed25519 (ssh-keygen -t ed25519) over RSA when your clients support it; it’s smaller and avoids the legacy-RSA question entirely. Keep RSA only as a fallback for old systems. And before setting PasswordAuthentication no, test the key login in a second session and keep the current session open so you don’t lock yourself out.

---

<div class="post-metadata">

**Author:** ![Shamino](https://talk.tidbits.com/user_avatar/talk.tidbits.com/shamino/32/19200_2.png) [@Shamino](https://talk.tidbits.com/u/Shamino)\
**Post date:** [December 2, 2026, 2:29pm UTC](https://talk.tidbits.com/t/remote-access-security/29944/4 "2026-12-02T14:29:54Z")

</div>

As the article mentions, merely being able to factor huge numbers in polynomial time doesn’t mean you can break keys in a _reasonable_ amount of time.

And RSA can use larger size keys. Nobody uses RSA with 1 Kbit keys anymore. And I know that the secure boot-loader for NVIDIA Jetson processors recommends that developers use RSA with 3 Kbit keys or one of three Elliptic-curve algorithms ([ECDSA](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm) P-256, ECDSA P-521 or [Ed25519](https://en.wikipedia.org/wiki/EdDSA#Ed25519)) for the secure hash used to sign boot images.

---

<div class="post-metadata">

**Author:** ![josehill](https://talk.tidbits.com/user_avatar/talk.tidbits.com/josehill/32/19289_2.png) [@josehill](https://talk.tidbits.com/u/josehill)\
**Post date:** [December 2, 2026, 5:08pm UTC](https://talk.tidbits.com/t/remote-access-security/29944/5 "2026-12-02T17:08:54Z")

</div>

> [@Shamino](#):
>
> Nobody uses RSA with 1 Kbit keys anymore.

Indeed. Most organizations use at keys with at least 2048 bits, and 4096 bit keys are increasingly common.
