Upload Ssl Private Key to Server Without Public Key
How to use SCP (secure copy) with ssh central authentication
How to use SCP (secure copy) with ssh key authentication
Hither'south how to use the secure copy command, in conjunction with ssh primal hallmark, for an fifty-fifty more secure means of copying files to your remote Linux servers.
Anyone that administers Linux machines knows secure beat out well. Without this tool it would be quite a claiming to remotely administrate those servers. It would also become quite a flake harder to move files back and forth, at least with a modicum of security. That's where secure re-create comes into play. With the scp command, you tin can copy files to and from a remote Linux server, through an encrypted ssh tunnel.
Nonetheless, with the aid of ssh central authentication, you can brand that fifty-fifty more secure. I want to show yous how y'all can make use of secure fundamental authentication, along with scp, so yous can rest assured your files are existence moved back and forth securely. I will be demonstrating on an Elementary OS customer and Ubuntu 16.04.1 server and will assume you have secure shell installed and working.
ssh keys
The first thing that must be done is the creation of an ssh key pair. To do this, open up up a terminal window and effect the command:
ssh-keygen -t rsa
You volition exist asked to name the file (use the default) and give the keypair a passphrase (Figure A).
Figure A

Once the key's randomart prints, your fundamental is set up to go.
The adjacent step is to copy the cardinal to the remote server. This is done with the command:
ssh-copy-id USER@SERVER
Where USER is the username on the remote server and SERVER is the address of the remote server.
Y'all will be prompted for the remote user countersign. Once you successfully authenticate, the public key volition exist copied to the server. You lot're ready to go.
SEE: Securing Linux policy (Tech Pro Research)
Using scp with your cardinal
Now that our keys are in all the right places, permit'south encounter how we can brand use of them, through scp. The control to send a file to your remote server, using your ssh primal, is (assuming yous accepted the default name for your ssh key upon cosmos):
scp -i ~/.ssh/id_rsa.pub FILENAME USER@SERVER:/home/USER/FILENAME
Where FILENAME is the name of the file, USER is the username on the remote machine, and SERVER is the accost of the remote server.
You lot should be prompted for the ssh primal password (not the user password). Once authenticated, the file will be transferred.
The same holds truthful if yous need to pull a file from the remote server. The structure of that control would exist:
scp -i ~/.ssh/id_rsa.pub USER@SERVER:/home/USER/FILENAME /home/USER/FILENAME
Over again, you lot will be asked for your ssh key password and the file will exist pulled from the server and copied to the local machine.
Forget that password
Let's say you are about to undergo a long session of copying files to your server. Certain y'all could tar them all up into one bigger file, but say they need to all be placed in different directories. That'south a lot of typing. You can make this slightly more than efficient by using the ssh-amanuensis and ssh-add commands. That's right, using the combination of scp, ssh key authentication, and ssh-amanuensis works actually well. What this will do is keep you from having to type that ssh key password every time you issue the scp control. The one caveat to this is that you must remember the PID of the agent session and kill it when you're done.
Here's what you lot take to do.
- Earlier issuing the scp command consequence eval `ssh-agent` to get-go the session
- Make note of the Procedure ID (PID) y'all are given when the session starts
- Add your ssh cardinal to the session with the command ssh-add
- Get-go using scp to copy your files
That's all there is to it. When you're washed with the session, make sure to upshot the command kill PID (Where PID is the actual number given to you when you started the ssh-agent session with eval).
Encounter: 20 quick tips to make Linux networking easier (free PDF) (TechRepublic)
Added security and ease
And that, my friends, is how you make apply of ssh key hallmark with the scp command. It may not change your world, but it will certainly make it a fleck more secure and, with the help of ssh-agent, a fleck easier.

Also Meet
- iii tips to brand using ssh easier (TechRepublic Video)
- How to prepare SSH keys in Seahorse (TechRepublic)
- How to install and apply GPG Suite to encrypt electronic mail with Apple Mail (TechRepublic)
- How to use local and remote SSH port forwarding (TechRepublic)
- How to use Let's Encrypt to secure your websites (ZDNet)
- Networking
- Open up source
- Security
Source: https://www.techrepublic.com/article/how-to-use-secure-copy-with-ssh-key-authentication/
Postar um comentário for "Upload Ssl Private Key to Server Without Public Key"