Host your-host # 使用者定義的別名,可以用別名來替代 ssh userName@ip HostName your-host-name # ip 或是 server name User your-user # user name
# 在 Windows 上 ssh-keygen -t rsa -b 2048 -f C:\Users\YourUsername\.ssh\id_rsa_windows # 在 mac 上 ssh-keygen -t rsa -b 2048 -f /Users/chunhungyu/.ssh/id_rsa_windows
# 建立目錄 mkdir ~/.ssh # 進入目錄 cd ~/.ssh # 建立 authorized_keys 文件 touch authorized_keys # 使用文字編輯器開啟 authorized_keys 文件,並將你的公鑰內容貼到其中,nano or vim vim authorized_keys # 儲存並關閉文字編輯器。
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up