大网数据广告活动
服务器运维问答

Using SSH keys from backup on another machine to access server

· 52CE 我爱测

I created a server, and configured SSH to not allow root login and disable password access, so only accepts an SSH key to login. I have a machine A with a key, and I can access my server from that machine without any problems. Al…

问题原文

原帖链接 · Pablo Pazos · CC BY-SA 4.0

I created a server, and configured SSH to not allow root login and disable password access, so only accepts an SSH key to login.

I have a machine A with a key, and I can access my server from that machine without any problems.

Also have a backup of those keys, just in case.

Let's say my machine A dies tomorrow and I got a new machine B, and of course need to access my server.

Here I don't know how things work. Should I just copy the keys from my backup to machine B and that will allow me to access my server? Or should the keys be imported via some OpenSSH command?

So my first doubt is about the backup import, because I'm afraid to completely lose access to my server.

The second is about the passphrase I set for my keys on machine A. Is that still valid for my copied keys? Or through the import I need to set a new passphrase on the new machine.

Thanks.

社区高分解答

原帖链接 · womble · CC BY-SA 4.0

Copying the backed-up keys into place will work fine. No specific import command is required. A passphrase is a property of a key file (specifically, it is the input to a key-derivation function to generate an encryption key for the private key data).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-07-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。