-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ee10b0
commit 33bd192
Showing
5 changed files
with
117 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@echo off | ||
setlocal | ||
|
||
echo Start... | ||
|
||
REM Detect if we're on Windows and set the SSH key path | ||
set "SSH_KEY_PATH=%USERPROFILE%\.ssh\id_rsa" | ||
|
||
REM Show the path where the SSH key will be generated | ||
echo Path to generate SSH key: %SSH_KEY_PATH% | ||
|
||
REM Check if the SSH key already exists | ||
if exist "%SSH_KEY_PATH%" ( | ||
echo SSH key already exists at %SSH_KEY_PATH% | ||
) else ( | ||
REM Create the .ssh directory if it doesn't exist | ||
if not exist "%USERPROFILE%\.ssh" ( | ||
mkdir "%USERPROFILE%\.ssh" | ||
echo Directory created: %USERPROFILE%\.ssh | ||
) else ( | ||
echo Directory already exists: %USERPROFILE%\.ssh | ||
) | ||
|
||
REM Generate an SSH key without a passphrase (-N "") and without interaction (-q) | ||
ssh-keygen -t rsa -b 4096 -f "%SSH_KEY_PATH%" -N "" -q | ||
|
||
REM Show success message | ||
echo SSH key generated at %SSH_KEY_PATH% | ||
) | ||
|
||
endlocal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters