7 if [ ! -d "$HOME/.ssh" ]; then
9 chmod 0700 "$HOME/.ssh/"
12 if [ ! -f "$HOME/.ssh/config" ]; then
13 # for the benefit of VSCode
14 touch "$HOME/.ssh/config"
15 chmod 0644 "$HOME/.ssh/config"
18 if [ ! -f "$HOME/.ssh/authorized_keys" ]; then
19 touch "$HOME/.ssh/authorized_keys"
20 chmod 0600 "$HOME/.ssh/authorized_keys"
23 if [ ! -f "$HOME/.ssh/id_rsa" ]; then
24 ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
28 if [ ! -f "$HOME/.ssh/id_rsa.pub" ]; then
29 ssh-keygen -y -f "$HOME/.ssh/id_rsa" > "$HOME/.ssh/id_rsa.pub"
33 # TODO use the comment (if any) for the name of the file
35 echo "~/Downloads/id_rsa.$(whoami).pub":
37 rm -f "$HOME/Downloads/id_rsa.$(whoami).pub":
38 cp -r "$HOME/.ssh/id_rsa.pub" "$HOME/Downloads/id_rsa.$(whoami).pub"
39 cat "$HOME/Downloads/id_rsa.$(whoami).pub"