Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




15.6. OpenSSH Per-User Configuration

  1. Create your private & public keys of local, by executing:
              [root@deep] /#su admin
              [admin@deep /]$ssh-keygen
    The result should look like the following example:
              Initializing random number generator...
              Generating p:  ............................++ (distance 430)
              Generating q:  ......................++ (distance 456)
              Computing the keys...
              Testing the keys...
              Key generation complete.
              Enter file in which to save the key (/home/admin/.ssh/identity): [Press Enter]
              Enter passphrase: 
              Enter the same passphrase again: 
              Your identification has been saved in /home/admin/.ssh/identity.
              Your public key is:
              1024 37 14937757511251955533691120318477293862290049394715136511145806108870001764378494676831297577843158532
              [email protected]
              Your public key has been saved in /home/admin/.ssh/

    Note: If you have multiple accounts you might want to create a separate key on each of them. You may want to have separate keys for:

    • Your Mail server

    • Your Web server

    • Your GW server

    This allows you to limit access between these servers, e.g. not allowing the Mail account to access your Web account or the machines in the GW. This enhances the overall security in the case any of your authentication keys are compromised for any reason.

  2. Copy your local public keys to the /home/admin/.ssh directory remotely under the name, say, authorized_keys.

    Tip: One way to copy the file is to use the ftp command or you might need to send your public key in electronic mail to the administrator of the system. Just include the contents of the ~/.ssh/ file in the message.

You might feel the need to Change your pass-phrase for various reason and can do so at any time by using the -p option of ssh-keygen. To change the pass-phrase, use the command:
          [root@deep] /#su admin
          [admin@deep /]$ssh-keygen -p

          Enter file key is in /home/admin/.ssh/identity: [Press ENTER]
          Enter old passphrase:
          Key has comment '[email protected]'
          Enter new passphrase:
          Enter the same passphrase again:
          Your identification has been saved with the new passphrase.

  Published under the terms of the Open Publication License Design by Interspire