Skip to content

Commit

Permalink
Updated name of default ssh key
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlo committed Feb 6, 2024
1 parent 0767772 commit 19c9327
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions dardel_ssh-keygen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ key_changed=false
config_changed=false

# Check if the ssh key file already exists
while [[ -f ~/.ssh/id-ed25519-pdc ]]; do
while [[ -f ~/.ssh/id_ed25519-pdc ]]; do
read -p "The ssh key file already exists. Do you want to overwrite it (o), continue without changing it (c), or delete it (d)? (o/c/d): " option

# If the user wants to overwrite the file
if [[ $option == "o" ]]; then
echo "Removing old ssh key."
rm ~/.ssh/id-ed25519-pdc
rm ~/.ssh/id_ed25519-pdc
key_changed=true
break

Expand All @@ -23,15 +23,15 @@ while [[ -f ~/.ssh/id-ed25519-pdc ]]; do
# If the user wants to add a password
elif [[ $option == "d" ]]; then
echo "Deleting the ssh key."
rm ~/.ssh/id-ed25519-pdc
rm ~/.ssh/id_ed25519-pdc
key_deleted=true
break
fi
done

# Create the ssh key without a password unless it should be deleted
if [[ ! -f ~/.ssh/id-ed25519-pdc ]] && [[ $option != "d" ]]; then
ssh-keygen -q -t ed25519 -f ~/.ssh/id-ed25519-pdc -N ""
if [[ ! -f ~/.ssh/id_ed25519-pdc ]] && [[ $option != "d" ]]; then
ssh-keygen -q -t ed25519 -f ~/.ssh/id_ed25519-pdc -N ""
key_changed=true
fi

Expand Down
4 changes: 2 additions & 2 deletions darsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def msg(id, lang='en', **kwargs):
4) Where on Dardel it should transfer your data to.
ex. /cfs/klemming/projects/snic/naiss2099-23-999/from_uppmax
5) Which SSH key should be used when connecting to Dardel.
ex. /home/user/.ssh/id-ed25519-pdc
ex. /home/user/.ssh/id_ed25519-pdc
6) Where you want to save the generated SLURM script.
""",

Expand Down Expand Up @@ -122,7 +122,7 @@ def msg(id, lang='en', **kwargs):
Specify Dardel path: """,

"input_ssh_key": """\n\nSpecify which SSH key should be used to login to Dardel. Create one by running `dardel_ssh-keygen` if you have not done so yet. If no path is given it will use the default key created by `dardel_ssh-keygen`, ~/.ssh/id-ed25519-pdc
"input_ssh_key": """\n\nSpecify which SSH key should be used to login to Dardel. Create one by running `dardel_ssh-keygen` if you have not done so yet. If no path is given it will use the default key created by `dardel_ssh-keygen`, ~/.ssh/id_ed25519-pdc
Specify SSH key: """,

Expand Down

0 comments on commit 19c9327

Please sign in to comment.