A key is a pair of files: the private one stays with you, the public one sits on the server. Unlike a password, a key practically cannot be brute-forced, and you type nothing at login.
Path – press Enter. Never share the private key ~/.ssh/id_ed25519, the public ~/.ssh/id_ed25519.pub goes on the server.
Passphrase – a password on the key itself, set one: a stolen file is useless without it. To avoid typing it every time: ssh-add ~/.ssh/id_ed25519.
Key to the server – replace IP with the Server IP from the card (My servers → server). The command asks for the root password once:
ssh-copy-id root@IP
No ssh-copy-id – print the key with cat ~/.ssh/id_ed25519.pub and add it manually as in the section below.
Key – in PowerShell, OpenSSH is built into Windows 10/11:
ssh-keygen -t ed25519 -C "lumi-vps"
Press Enter at the path question. The keys land in C:\Users\NAME\.ssh\: id_ed25519 is private, id_ed25519.pub is public.
Key line – print it and add it to the server manually as in the section below:
type $env:USERPROFILE\.ssh\id_ed25519.pub
PuTTY – the key is made in PuTTYgen: type EdDSA (Ed25519), Generate, then Save private key (a .ppk file). Add the line from the field at the top of the window to the server manually, and set the .ppk file in PuTTY: Connection → SSH → Auth → Credentials → Private key file.
Logged in without the server password – the key works. If you set a passphrase, you are asked for it: that is the password for the key on your computer, not for the server.
Once key login works, you can turn the password off: there is nothing left to brute-force.
Check key login first. Turn the password off too early and you lose access to the server. If that happens, log in through Console on the server card, not every server has it.
SSH settings – open them on the server:
nano /etc/ssh/sshd_config
No password – find the PasswordAuthentication line, remove the leading # if there is one, and make it:
PasswordAuthentication no
Save: Ctrl+O, Enter, Ctrl+X. Also look in /etc/ssh/sshd_config.d/: a PasswordAuthentication yes line in files there overrides the main file, change it to no.
Restart SSH – the current connection stays open:
systemctl restart ssh
On AlmaLinux, Rocky, and CentOS the service is called sshd. Check the result with sshd -T | grep -i passwordauthentication: it should say passwordauthentication no. Before closing the connection, check key login in a second window.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Lumi","description":"Серверы VPS Lumi: настройка, подключение и решение проблем","colors":{"primary":"#0EA5E9","light":"#38BDF8","dark":"#0284C7"},"logo":{"light":"https://mintcdn.com/lumi-8e9f3d35/2MclTGnmS1VG2Abe/logo.svg?fit=max\u0026auto=format\u0026n=2MclTGnmS1VG2Abe\u0026q=85\u0026s=f86070567b66af34654de1a77f8360ff","dark":"https://mintcdn.com/lumi-8e9f3d35/2MclTGnmS1VG2Abe/logo.svg?fit=max\u0026auto=format\u0026n=2MclTGnmS1VG2Abe\u0026q=85\u0026s=f86070567b66af34654de1a77f8360ff"},"favicon":"https://mintcdn.com/lumi-8e9f3d35/eTLjd4bhyqCNp3WB/favicon.svg?fit=max\u0026auto=format\u0026n=eTLjd4bhyqCNp3WB\u0026q=85\u0026s=07499b3f01b1b78ec5d44f31210e6dd8","appearance":{"default":"dark"},"background":{"color":{"light":"#F6F5F4","dark":"#1E1E1F"}},"navbar":{"links":[],"primary":{"type":"button","label":"Канал Lumi","href":"https://t.me/+7XIA2JUDcbAyNjA0"}},"footer":{"socials":{}},"search":{"prompt":"Поиск"},"fonts":{"family":"Inter"},"styling":{"codeblocks":"system","latex":false},"contextual":{"options":[],"display":"header"},"navigation":{"languages":[{"language":"ru","default":true,"href":"vps"},{"language":"en","href":"en/vps"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lumi-8e9f3d35","hasAudioNarration":false,"actualSubdomain":"lumi-8e9f3d35","customDomains":["wiki.lumiweb.cc"],"gitSource":{"type":"github","owner":"nvrloseeee-hash","repo":"lumidocs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ac6411e78c1c22ae0f1c88e","collectionId":"bb88e502-e415-4c87-91bb-dba60129529b","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ac6411e78c1c22ae0f1c88e"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ac6411e78c1c22ae0f1c88e","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"en","tag":"VPS","count":26},{"language":"ru","tag":"VPS","count":26},{"language":"en","tag":"Software \u0026 services","count":12},{"language":"ru","tag":"Софт и сервисы","count":12},{"language":"en","tag":"Setup","count":8},{"language":"ru","tag":"Настройка","count":8},{"language":"en","tag":"Basics","count":4},{"language":"ru","tag":"Основное","count":4},{"language":"en","tag":"Protection \u0026 issues","count":2},{"language":"ru","tag":"Защита и проблемы","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#sidebar-content{width:16rem!important}#sidebar-content a{white-space:nowrap}"}],"page":{"pagePath":"en/vps/ssh-keys","slug":"/en/vps/ssh-keys","pageMetadata":{"title":"SSH keys","sidebarTitle":"SSH keys","description":"Key-based login instead of a password","icon":"key","href":"/en/vps/ssh-keys"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Key-based login instead of a password\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tab,Tabs,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`A key is a pair of files: the private one stays with you, the public one sits on the server. Unlike a password, a key practically cannot be brute-forced, and you type nothing at login.`}),`\n`,_jsx(Heading,{level:`2`,id:`creating-a-key`,children:`Creating a key`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Linux / macOS`,id:`linux-%2F-macos`,children:_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Key`}),` – in the terminal on your own computer:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ssh-keygen`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -t`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ed25519`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -C`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"lumi-vps\"`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`At the prompts:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Path`}),` – press Enter. Never share the private key `,_jsx(_components.code,{children:`~/.ssh/id_ed25519`}),`, the public `,_jsx(_components.code,{children:`~/.ssh/id_ed25519.pub`}),` goes on the server.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Passphrase`}),` – a password on the key itself, set one: a stolen file is useless without it. To avoid typing it every time: `,_jsx(_components.code,{children:`ssh-add ~/.ssh/id_ed25519`}),`.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Key to the server`}),` – replace `,_jsx(_components.code,{children:`IP`}),` with the `,_jsx(_components.strong,{children:`Server IP`}),` from the card (`,_jsx(_components.strong,{children:`My servers`}),` → server). The command asks for the root password once:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ssh-copy-id`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` root@IP`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`No `,_jsx(_components.code,{children:`ssh-copy-id`}),` – print the key with `,_jsx(_components.code,{children:`cat ~/.ssh/id_ed25519.pub`}),` and add it manually as in the section below.`]}),`\n`]}),`\n`]})}),_jsxs(Tab,{title:`Windows`,id:`windows`,children:[_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Key`}),` – in PowerShell, OpenSSH is built into Windows 10/11:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`powershell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`powershell`,children:_jsxs(_components.code,{language:`powershell`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ssh`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`keygen `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`t ed25519 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`C `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"lumi-vps\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Press Enter at the path question. The keys land in `,_jsx(_components.code,{children:`C:\\\\Users\\\\NAME\\\\.ssh\\\\`}),`: `,_jsx(_components.code,{children:`id_ed25519`}),` is private, `,_jsx(_components.code,{children:`id_ed25519.pub`}),` is public.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Key line`}),` – print it and add it to the server manually as in the section below:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`powershell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`powershell`,children:_jsxs(_components.code,{language:`powershell`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`type `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`env:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`USERPROFILE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\\\\.ssh\\\\id_ed25519.pub`})]}),`\n`]})})}),`\n`]}),`\n`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`PuTTY`}),` – the key is made in PuTTYgen: type `,_jsx(_components.code,{children:`EdDSA`}),` (Ed25519), `,_jsx(_components.strong,{children:`Generate`}),`, then `,_jsx(_components.strong,{children:`Save private key`}),` (a `,_jsx(_components.code,{children:`.ppk`}),` file). Add the line from the field at the top of the window to the server manually, and set the `,_jsx(_components.code,{children:`.ppk`}),` file in PuTTY: `,_jsx(_components.strong,{children:`Connection → SSH → Auth → Credentials → Private key file`}),`.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`manual-setup`,children:`Manual setup`}),`\n`,_jsxs(_components.p,{children:[`Log in to the server with the password: `,_jsx(_components.code,{children:`ssh root@IP`}),`. Then:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`mkdir`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -p`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ~/.ssh`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026 `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`chmod`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 700`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ~/.ssh`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"PASTE_KEY_HERE\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ~/.ssh/authorized_keys`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`chmod`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 600`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ~/.ssh/authorized_keys`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`PASTE_KEY_HERE`}),` – the whole public key line.`]}),`\n`,_jsx(Heading,{level:`2`,id:`check`,children:`Check`}),`\n`,_jsx(_components.p,{children:`Connect again:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ssh`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` root@IP`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Logged in without the server password – the key works. If you set a passphrase, you are asked for it: that is the password for the key on your computer, not for the server.`}),`\n`,_jsx(Heading,{level:`2`,id:`disabling-the-password`,children:`Disabling the password`}),`\n`,_jsx(_components.p,{children:`Once key login works, you can turn the password off: there is nothing left to brute-force.`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Check key login first. Turn the password off too early and you lose access to the server. If that happens, log in through `,_jsx(_components.strong,{children:`Console`}),` on the server card, not every server has it.`]})}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`SSH settings`}),` – open them on the server:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`nano`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` /etc/ssh/sshd_config`})]}),`\n`]})})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`No password`}),` – find the `,_jsx(_components.code,{children:`PasswordAuthentication`}),` line, remove the leading `,_jsx(_components.code,{children:`#`}),` if there is one, and make it:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PasswordAuthentication no`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Save: `,_jsx(_components.code,{children:`Ctrl+O`}),`, Enter, `,_jsx(_components.code,{children:`Ctrl+X`}),`. Also look in `,_jsx(_components.code,{children:`/etc/ssh/sshd_config.d/`}),`: a `,_jsx(_components.code,{children:`PasswordAuthentication yes`}),` line in files there overrides the main file, change it to `,_jsx(_components.code,{children:`no`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Restart SSH`}),` – the current connection stays open:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`systemctl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` restart`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ssh`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`On AlmaLinux, Rocky, and CentOS the service is called `,_jsx(_components.code,{children:`sshd`}),`. Check the result with `,_jsx(_components.code,{children:`sshd -T | grep -i passwordauthentication`}),`: it should say `,_jsx(_components.code,{children:`passwordauthentication no`}),`. Before closing the connection, check key login in a `,_jsx(_components.strong,{children:`second`}),` window.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Next: `,_jsx(_components.a,{href:`/en/vps/hardening`,children:`Server hardening`}),`, `,_jsx(_components.a,{href:`/en/vps/firewall`,children:`Firewall`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"system","config":{},"pageMetadata":{"title":"SSH keys","sidebarTitle":"SSH keys","description":"Key-based login instead of a password","icon":"key","href":"/en/vps/ssh-keys"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Creating a key","slug":"creating-a-key","depth":2,"children":[]},{"title":"Manual setup","slug":"manual-setup","depth":2,"children":[]},{"title":"Check","slug":"check","depth":2,"children":[]},{"title":"Disabling the password","slug":"disabling-the-password","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"lumi-8e9f3d35","siteName":"Lumi","title":"SSH keys - Lumi","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"ru":{"href":"/vps/ssh-keys","matchLevel":1},"en":{"href":"/en/vps/ssh-keys","matchLevel":0}}},"lastModified":"2026-10-04T13:36:56.592Z","originalFileLocation":"en/vps/ssh-keys.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Key-based login instead of a password\">\u003cmeta data-mint-head name=\"application-name\" content=\"Lumi\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lumi-8e9f3d35/xL3B4vgHb9JI4RjC/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/lumi-8e9f3d35/xL3B4vgHb9JI4RjC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lumi-8e9f3d35/xL3B4vgHb9JI4RjC/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lumi-8e9f3d35/xL3B4vgHb9JI4RjC/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lumi-8e9f3d35/xL3B4vgHb9JI4RjC/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lumi-8e9f3d35/xL3B4vgHb9JI4RjC/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lumi-8e9f3d35/xL3B4vgHb9JI4RjC/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lumi-8e9f3d35/xL3B4vgHb9JI4RjC/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lumi-8e9f3d35/xL3B4vgHb9JI4RjC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"SSH keys - Lumi\">\u003cmeta data-mint-head property=\"og:description\" content=\"Key-based login instead of a password\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Lumi\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://wiki.lumiweb.cc/en/vps/ssh-keys\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lumi-8e9f3d35.mintlify.app/_mintlify/api/og/v2?division=Setup\u0026amp;title=SSH+keys\u0026amp;description=Key-based+login+instead+of+a+password\u0026amp;theme=7c698ff8427173e2bbc2bba2\u0026amp;signature=1d2bbd2fa2ee2145f2beaa6aa2c973de4b7df2f6cad7e2d9622e58a8b02efb00\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"SSH keys - Lumi\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Key-based login instead of a password\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lumi-8e9f3d35.mintlify.app/_mintlify/api/og/v2?division=Setup\u0026amp;title=SSH+keys\u0026amp;description=Key-based+login+instead+of+a+password\u0026amp;theme=7c698ff8427173e2bbc2bba2\u0026amp;signature=1d2bbd2fa2ee2145f2beaa6aa2c973de4b7df2f6cad7e2d9622e58a8b02efb00\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/lumi-8e9f3d35/xL3B4vgHb9JI4RjC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Lumi\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0EA5E9\">\u003clink data-mint-head rel=\"canonical\" href=\"https://wiki.lumiweb.cc/en/vps/ssh-keys\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/vps/ssh-keys.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://wiki.lumiweb.cc/en/vps/ssh-keys\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ru\" href=\"https://wiki.lumiweb.cc/vps/ssh-keys\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://wiki.lumiweb.cc/vps/ssh-keys\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://wiki.lumiweb.cc/#organization\",\"name\":\"Lumi\",\"url\":\"https://wiki.lumiweb.cc\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/lumi-8e9f3d35/2MclTGnmS1VG2Abe/logo.svg?fit=max\u0026auto=format\u0026n=2MclTGnmS1VG2Abe\u0026q=85\u0026s=f86070567b66af34654de1a77f8360ff\"}},{\"@type\":\"WebSite\",\"@id\":\"https://wiki.lumiweb.cc#website\",\"name\":\"Lumi\",\"url\":\"https://wiki.lumiweb.cc\",\"publisher\":{\"@id\":\"https://wiki.lumiweb.cc/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://wiki.lumiweb.cc/en/vps/ssh-keys#webpage\",\"url\":\"https://wiki.lumiweb.cc/en/vps/ssh-keys\",\"name\":\"SSH keys\",\"description\":\"Key-based login instead of a password\",\"dateModified\":\"2026-10-04T13:36:56.592Z\",\"isPartOf\":{\"@id\":\"https://wiki.lumiweb.cc#website\"},\"breadcrumb\":{\"@id\":\"https://wiki.lumiweb.cc/en/vps/ssh-keys#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://wiki.lumiweb.cc/en/vps/ssh-keys#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Lumi\",\"item\":\"https://wiki.lumiweb.cc\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSH keys\",\"item\":\"https://wiki.lumiweb.cc/en/vps/ssh-keys\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://wiki.lumiweb.cc/en/vps/ssh-keys#article\",\"headline\":\"SSH keys\",\"name\":\"SSH keys\",\"description\":\"Key-based login instead of a password\",\"url\":\"https://wiki.lumiweb.cc/en/vps/ssh-keys\",\"mainEntityOfPage\":{\"@id\":\"https://wiki.lumiweb.cc/en/vps/ssh-keys#webpage\"},\"dateModified\":\"2026-10-04T13:36:56.592Z\",\"publisher\":{\"@id\":\"https://wiki.lumiweb.cc/#organization\"},\"isPartOf\":{\"@id\":\"https://wiki.lumiweb.cc#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Lumi\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Lumi","nav":{"global":null,"languages":[{"language":"ru","default":true,"pages":[{"title":"ru","href":"/vps/ssh-keys"}]},{"language":"en","tabs":[{"tab":"VPS","icon":"server","groups":[{"group":"Basics","icon":"server","pages":[{"title":"VPS plans","sidebarTitle":"Plans","icon":"gauge-high","href":"/en/vps"},{"title":"Server management","sidebarTitle":"Management","icon":"sliders","href":"/en/vps/manage"},{"title":"Locations and OS","sidebarTitle":"Locations and OS","icon":"earth-europe","href":"/en/vps/os"},{"title":"Connection","sidebarTitle":"Connection","description":"SSH, RDP, and the web console","icon":"terminal","href":"/en/vps/connect"}]},{"group":"Setup","icon":"screwdriver-wrench","pages":[{"title":"SSH keys","sidebarTitle":"SSH keys","icon":"key","href":"/en/vps/ssh-keys"},{"title":"Firewall (ufw)","sidebarTitle":"Firewall","description":"Open the ports you need, close off the rest","icon":"shield-halved","href":"/en/vps/firewall"},{"title":"Backups","sidebarTitle":"Backups","icon":"box-archive","href":"/en/vps/backups"},{"title":"Swap file","sidebarTitle":"Swap","icon":"memory","href":"/en/vps/swap"},{"title":"Network configuration","sidebarTitle":"Network","icon":"network-wired","href":"/en/vps/network"},{"title":"Reverse DNS (PTR)","sidebarTitle":"Reverse DNS","icon":"arrows-rotate","href":"/en/vps/reverse-dns"},{"title":"Web server (Nginx)","sidebarTitle":"Web server","icon":"server","href":"/en/vps/webserver"},{"title":"SSL and Let's Encrypt","sidebarTitle":"SSL","icon":"lock","href":"/en/vps/ssl"}]},{"group":"Protection \u0026 issues","icon":"shield-halved","pages":[{"title":"Server hardening","sidebarTitle":"Hardening","icon":"lock","href":"/en/vps/hardening"},{"title":"VPS not working","sidebarTitle":"Not working","icon":"triangle-exclamation","href":"/en/vps/troubleshooting"}]},{"group":"Software \u0026 services","icon":"cubes","pages":[{"title":"WireGuard VPN","sidebarTitle":"WireGuard","icon":"shield-halved","href":"/en/vps/wireguard"},{"title":"OpenVPN","sidebarTitle":"OpenVPN","icon":"lock","href":"/en/vps/openvpn"},{"title":"Amnezia (no terminal)","sidebarTitle":"Amnezia","icon":"user-shield","href":"/en/vps/amnezia"},{"title":"3X-UI (Xray/VLESS)","sidebarTitle":"3X-UI","icon":"gauge-high","href":"/en/vps/3x-ui"},{"title":"Marzban","sidebarTitle":"Marzban","icon":"layer-group","href":"/en/vps/marzban"},{"title":"Your own proxy (3proxy)","sidebarTitle":"Your own proxy","icon":"network-wired","href":"/en/vps/proxy-3proxy"},{"title":"Docker","sidebarTitle":"Docker","icon":"box","href":"/en/vps/docker"},{"title":"n8n (automation)","sidebarTitle":"n8n","icon":"diagram-project","href":"/en/vps/n8n"},{"title":"Keitaro (tracker)","sidebarTitle":"Keitaro","icon":"chart-line","href":"/en/vps/keitaro"},{"title":"Your own LLM (Ollama)","sidebarTitle":"Your own LLM","icon":"robot","href":"/en/vps/llm"},{"title":"MikroTik CHR","sidebarTitle":"MikroTik","icon":"route","href":"/en/vps/mikrotik"},{"title":"Coolify (your own PaaS)","sidebarTitle":"Coolify","icon":"rocket","href":"/en/vps/panel"}]}]}]}]},"title":"SSH keys - Lumi","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":[],"chunks":[]}