Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 ssh intro and login #9

Merged
merged 21 commits into from
Feb 12, 2025
Merged

📝 ssh intro and login #9

merged 21 commits into from
Feb 12, 2025

Conversation

Scorpicathe
Copy link
Contributor

@Scorpicathe Scorpicathe commented Feb 5, 2025

Working on #6

Roadmap:

  • ssh intro
  • ssh main usage
    • ssh login
    • scp
  • ssh walkthrough
  • other ssh application
    • vscode
    • github

I’m not very familiar with SSH, feel free to point out any mistakes 😭

@Orion-zhen
Copy link
Contributor

Wow, I love you, my cuty sweety femboy 😘

Copy link
Member

@root-hbx root-hbx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM! cc @Orion-zhen

Copy link
Contributor

@Orion-zhen Orion-zhen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


一些常用可选项:
- `[-t rsa | dsa | ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa]`:指定加密算法,不同加密算法复杂性和安全性也不同
- `[-b bits]`指定密钥长度,有些加密算法,如rsa,密钥长度是可以变化的
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对 RSA 算法, 常见的长度是 2048, 3072, 4096. 一般推荐 3072 长度, 是安全性和性能的最佳平衡. 4096 长度的密钥能提供最高的安全性, 但是加解密的时间会显著增加. 不过在现代计算机上, 椭圆加密的 ed25519 是更好的选择, 因为它兼顾了安全性和性能.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢 @Orion-zhen 我会把这部分内容加入进去 🌹

src/dev/ssh.md Outdated
然后我们需要将公钥复制到服务器上,这可以使用以下命令:

```bash
ssh_copy_id [-i /your/path/to/ssh/keypair.pub user@host]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在 Windows 平台上并没有这个命令, 所以需要手动将公钥复制到服务器的 ~/.ssh/authorized_keys 文件中. 一个非常 tricky 的点在于, Linux 系统对 ~/.ssh 目录的权限和 ~/.ssh/authorized_keys 的权限是有要求的. 要求 ~/.ssh 目录的权限为 600 或 700, ~/.ssh/authorized_keys 的权限为 600. 否则配置不起效.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我原本打算附上实操的例子,不过我今天才回到学校,估计明天会去工位拿主机实操一下,到时候可能会修改部分遗留的错误。

@Scorpicathe
Copy link
Contributor Author

另外,我手边没有macOS和windows环境,不太清楚ssh在这两个系统上的流程(感觉mac应该大差不差,windows会很不一样?),有关这两个系统的内容可能需要 @root-hbx @Orion-zhen 帮忙 😊 💗

@root-hbx
Copy link
Member

root-hbx commented Feb 9, 2025

另外,我手边没有macOS和windows环境,不太清楚ssh在这两个系统上的流程(感觉mac应该大差不差,windows会很不一样?),有关这两个系统的内容可能需要 @root-hbx @Orion-zhen 帮忙 😊 💗

亲测,MacOS和目前文档里给到的过程完全一致😍

文档写的非常非常详细!感谢 @Scorpicathe 相信会很有助于今年选课同学对SSH的了解与实操 :))

Copy link
Member

@root-hbx root-hbx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good. I believe it is ready to go :))

@root-hbx root-hbx merged commit 18f1f46 into xjtu-ics:main Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants