Differences
This shows you the differences between the selected revisions of the page.
| 2026-03-25 | 2026-03-26 | ||
| How to access server folders if initially not logged as root through WinSCP (195.225.58.253) | the general ssh setup does not belong there and not in this extent. replacing with shorter notice further down (martin) | ||
| Line 15: | Line 15: | ||
| Once logged in, configure your server to accept your public key. That varies with %%SSH%% server software being used. The most common %%SSH%% server is OpenSSH. | Once logged in, configure your server to accept your public key. That varies with %%SSH%% server software being used. The most common %%SSH%% server is OpenSSH. | ||
| - | |||
| - | You can remotely configure the server (to accept public key use) also using another program (Command Prompt) if WinSCP doesn't allow you to upload / modify / create files (for example when you logged as 'admin' and in the right side window of WinSCP you see 'root' as files owner - therefore WinSCP is working now just in read-only mode). Open a Command Prompt console, write 'ssh username@IP' (writing real IP with numbers syntax, like 124.12.0.15) click Enter, write the password, clic Enter. then again, write 'sudo -i' and click Enter, to create a root shell. From now on, you can list files and/or folders, using 'ls /' command, then navigate in server's folder structure, or create folders or files, and so on. That would be useful in order to create '.ssh' folder which is explained further. (In the end, after you finish working in the shell, write 'logout' and click Enter, to close the shell access, then again 'logout' and click Enter, to close the server connection.) | ||
| ==== [[configure_openssh]] OpenSSH ==== | ==== [[configure_openssh]] OpenSSH ==== | ||
| Line 28: | Line 26: | ||
| * Switch to the [[ui_puttygen|PuTTYgen]] window, select all of the text in the //[[ui_puttygen#authorized_keys|Public key for pasting into OpenSSH authorized_keys file]]// box, and copy it to the clipboard (''Ctrl+C''). Then, switch back to the editor and insert the data into the open file, making sure it ends up all on one line. Save the file. WinSCP can [[ui_login_authentication#private_key_tools|show you the public key]] too. | * Switch to the [[ui_puttygen|PuTTYgen]] window, select all of the text in the //[[ui_puttygen#authorized_keys|Public key for pasting into OpenSSH authorized_keys file]]// box, and copy it to the clipboard (''Ctrl+C''). Then, switch back to the editor and insert the data into the open file, making sure it ends up all on one line. Save the file. WinSCP can [[ui_login_authentication#private_key_tools|show you the public key]] too. | ||
| * Ensure that your account home directory, your ''.ssh'' directory and file ''authorized_keys'' are not group-writable or world-writable. Recommended permissions for ''.ssh'' directory are ''700''. Recommended permissions for ''authorized_keys'' files are ''600''. Read more about [[task_properties|changing permissions]]. | * Ensure that your account home directory, your ''.ssh'' directory and file ''authorized_keys'' are not group-writable or world-writable. Recommended permissions for ''.ssh'' directory are ''700''. Recommended permissions for ''authorized_keys'' files are ''600''. Read more about [[task_properties|changing permissions]]. | ||
| + | |||
| + | If you cannot log in directly with the account yet (e.g., you need to use ''sudo'' to switch to ''root''), you might not be able to use WinSCP to set up the key.((Although WinSCP can, with some limitations, [[faq_su|change user after login]], this is unlikely to work at this stage.)) In this case, set up the key using shell commands that replicate the procedure above. | ||
| ==== OpenSSH on Windows ==== | ==== OpenSSH on Windows ==== | ||