This commit is contained in:
2026-05-22 14:30:39 +08:00
parent d898d98a0e
commit adcbd04fe9

View File

@@ -23,6 +23,17 @@ export default function SshKeyPrompt({ nav }) {
<Box flexDirection="column">
<Text>Paste the contents of your <Text bold>.pub</Text> file (single line):</Text>
<Text dimColor>It will be appended to ~/.ssh/authorized_keys (dedup'd).</Text>
<Box flexDirection="column" marginTop={1} borderStyle="single" borderColor="gray" paddingX={1}>
<Text bold>How to get the .pub file from another machine</Text>
<Text dimColor>1. If you don't have one yet, generate it on that machine:</Text>
<Text> <Text color="cyan">ssh-keygen -t ed25519 -C "your_email@example.com"</Text></Text>
<Text dimColor> (press Enter at every prompt to accept defaults)</Text>
<Text dimColor>2. Print and copy the public key:</Text>
<Text> Linux/macOS: <Text color="cyan">cat ~/.ssh/id_ed25519.pub</Text></Text>
<Text> Windows (PowerShell): <Text color="cyan">type $env:USERPROFILE\.ssh\id_ed25519.pub</Text></Text>
<Text dimColor> (fall back to id_rsa.pub if you used RSA)</Text>
<Text dimColor>3. Copy the whole single line (starts with <Text color="cyan">ssh-ed25519</Text> / <Text color="cyan">ssh-rsa</Text>) and paste below.</Text>
</Box>
<Box marginTop={1}>
<Text>key </Text>
<TextInput value={key} onChange={(v) => { setKey(v); if (error) setError(null); }} />