Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7511745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:38:51+00:00 2026-05-29T23:38:51+00:00

I have a machine for a developer and I set up SSH key to

  • 0

I have a machine for a developer and I set up SSH key to allow them to access a server. The public and private keys in .ssh are obviously visible to the person.

Is there a way to protect these keys? If I do not want the possibility of those keys being copied over to another server, can I do anything?

The ssh-agent by default runs under the logged in user, so I probably cannot take away the user’s access rights to the ~/.ssh folder.

Thanks,
Tabrez

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:38:54+00:00Added an answer on May 29, 2026 at 11:38 pm

    You wish to allow the developer to USE the key but not COPY it.

    To do that, you could store the key on a server that the developer doesn’t have full access to. One way to implement this is like this:

    • Developer logs in to a special “key custodian” server where the key is stored. They could log in to this server using a different SSH key (not the one you are trying to control), a password, some form of 2-factor authentication, or anything else you choose which SSH supports.
    • The developer’s account on this server is configured with a forced command or a restricted shell which continues the process by carrying out these actions:
      • starts a new SSH agent (running on the key custodian server, of course)
      • loads the controlled key into that agent
      • launches an ssh connection to some other server with agent forwarding enabled.
    • The developer logs in to this second server (on which they must have an account). This second server is perhaps a general purpose server you already operate.

    The developer can now log in to other places from this second server by making use of the agent running on the key custodian server, but they never got access to any shell or opportunity to examine/copy files on the key custodian server.

    This solution suffers from the fact that all of the developer’s sessions are channeled through the key custodian server and also through the second shared server. This may be a disadvantage if the key custodian server is remote. It is also difficult and unintuitive for the developer to use this to transfer files (SCP or SFTP) back to their local machine.

    An alternate solution would involve writing software to create a stub SSH agent server locally on the developer’s machine that forwards SSH agent requests over a dedicated connection to the a real agent on the key custodian server. With a little work you can set up the dedicated connection to the key custodian server (itself an SSH connection, I recommend) automatically launch a simple subshell on the developer’s machine that has the stub ssh agent’s socket in its environment so they can “just use it”, and this solution can be really quite functional and user friendly. I have done this myself, but it’s way beyond the scope of a Stackoverflow answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You might have a set of properties that is used on the developer machine,
I have a VM on my Win 7 machine running Server 2008. My website
i have developed a small application and was working fine on developing machine but
I have three different development machines. Do I need three different iPhone Developer Program
I have a machine with VmWare installed which added two extra network interfaces. The
I have a machine which uses an NTP client to sync up to internet
I have a machine that is running Ubuntu Hardy, which provides its own RubyGems
I currently have a machine with an Opteron 275 (2.2Ghz), which is a dual
I am running a windows machine have installed Python 2.5. I also used the
Currently, I have a machine on which I am working in Eclipse, it says

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.