How to Configure GitHub Copilot SSH Read Only Access
You set up github copilot ssh read only access by pairing restricted Linux users with OpenSSH keys. You also limit what commands the AI coding agent can run in your editor. Many teams start by letting the agent use a developer's normal SSH key. This shortcut gives the assistant full write rights on remote servers. If the model misreads a prompt, a broad role lets it change files or stop services. A safe setup restricts the remote account to viewing logs and checking system state. How github co
Auditor Read-Only Access + SSH Access Management: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up github copilot ssh read only access by pairing restricted Linux users with OpenSSH keys. You also limit what commands the AI coding agent can run in your editor. Many teams start by letting the agent use a developer's normal SSH key. This shortcut gives the assistant full write rights on remote servers. If the model misreads a prompt, a broad role lets it change files or stop services. A safe setup restricts the remote account to viewing logs and checking system state.
How github copilot ssh read only access works on Linux hosts
GitHub Copilot runs inside your code editor and uses local tools to reach remote servers. When the agent runs a shell command, it uses your local SSH client to log in. To keep the session read only, you must create a restricted user on the Linux host. That Linux user needs group rights that allow reading log files and app folders. You must remove write rights on all system folders and service files for that account. You should also block that user from running admin commands on the remote host.
Teams often pair this restricted Linux account with OpenSSH user certificates instead of static keys. OpenSSH added certificate support in version 5.4 to simplify key management for users and hosts. An OpenSSH certificate holds a public key, identity info, principal names, and signed options. A Certification Authority key signs the certificate to prove the user is trusted by the server. Unlike TLS certificates, OpenSSH uses a much simpler format designed just for secure shell sessions. When the AI agent starts a session, the server checks the principal name on the certificate. It maps that principal to the read-only Linux user on the target host.
What native SSH controls solve and what they miss
Native OpenSSH certificates and Linux file permissions solve the login problem very well. They decide which user can log in and which files that user can change on disk. You can also attach options to an OpenSSH certificate when you sign it with your authority key. These options can force a fixed command or turn off port forwarding for that key. If you use a wrapper script, the remote shell can check the command string before running it. The script can allow basic check commands while rejecting file edits or service restarts.
Still, host-level setups leave major gaps when an AI coding agent interacts with live servers. First, SSH permissions only decide who logs in and which local files they can read. Once the session starts, a read-only user can still read every secret inside readable config files. If a log file holds customer emails, phone numbers, or card numbers, the agent gets them all. Those raw values flow straight back into the editor context and out to the model provider. Second, maintaining command wrapper scripts across dozens of Linux hosts takes constant work. A small mistake in a shell script lets a clever flag bypass your read-only rules. Native SSH also lacks a simple way to pause a single risky command for human approval. You either trust the key for the whole session or block the user entirely.
Auditor Read-Only Access + SSH Access Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Reducing data exposure during AI agent sessions
Keep the AI agent's workspace clean by separating human admin keys from agent keys. Never let an automated tool reuse an engineer's main SSH agent socket on their laptop. Store the agent's key in a separate file with a short validity window. By default, OpenSSH certificates last forever unless you set a time window when signing them. Always set a short window so old keys expire on their own after a work shift.
Next, check which files the read-only Linux user can open on the remote machine. Move environment files with API keys into folders owned by root with strict read rules. Give the read-only account access only to specific log paths and public status tools. Even with tight file rules, app logs often spill personal data like national IDs or emails. You need a way to inspect command output in flight and mask sensitive fields by default.
Add command and file guardrails to SSH access
Host firewalls and certificate principals control who opens an SSH session. Yet an allowed user or agent can still run a bad one-shot command or pull sensitive files over sftp. In practice, hoop.dev sits inline on the host as an open-source SSH server with guardrails that uses OpenSSH certificates. For every one-shot command or sftp task an agent or human runs in production, hoop.dev decides to pass, mask, block, or escalate it for review.
Using hoop.dev SSH controls, guardrails check one-shot commands, env variable names, and sftp or scp paths before they run. Port forwards default to deny unless the target is listed. Because interactive shells have no statement boundary and carry no guardrails, teams can turn them off so every command is checked and logged. Check out the MIT-licensed project on GitHub.
Frequently asked questions
Can OpenSSH certificates make a session read only by themselves?
No, an OpenSSH certificate only handles login trust, principal names, and basic session options. You still must set Linux file permissions or force a restricted script on the remote host.
Why shouldn't GitHub Copilot use my personal SSH key?
Your personal key likely has sudo rights or write access to production folders and services. If the AI agent runs a bad command, it inherits all of your destructive permissions.
How do I stop the AI agent from reading sensitive data in server logs?
Linux file permissions are all-or-nothing for each file, so a readable log exposes all its text. To hide emails or card numbers inside logs, you must filter the output stream in flight.
Related guides
In this post