7 if [ ! -d "$HOME/.ssh" ]; then
9 chmod 0700 "$HOME/.ssh/"
12 if [ ! -f "$HOME/.ssh/id_rsa" ]; then
13 ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
17 if [ ! -f "$HOME/.ssh/id_rsa.pub" ]; then
18 ssh-keygen -y -f "$HOME/.ssh/id_rsa" > "$HOME/.ssh/id_rsa.pub"
22 # TODO use the comment (if any) for the name of the file
24 echo "~/Downloads/id_rsa.$(whoami).pub":
26 rm -f "$HOME/Downloads/id_rsa.$(whoami).pub":
27 cp -r "$HOME/.ssh/id_rsa.pub" "$HOME/Downloads/id_rsa.$(whoami).pub"
28 cat "$HOME/Downloads/id_rsa.$(whoami).pub"