Quote:
Originally Posted by Coop_012
okay, say i want to add my phone, do i add a key or if im not really worried about it can i just let it be?
|
The best way is to add a key to the phone, but you can generate the key anywhere and then transfer the private half to the phone and the public half to the target machine.
It's usually considered a good idea have a unique key pair for each set of devices. So the phone should be using its own keys to connect to either the desktop or the laptop.
Quote:
Originally Posted by Coop_012
cause when i went to use the keygen command it wanted to overwrite the file which i said no to. If I hit yes would it keep the old keys?
|
You can use the -f option to name the key file someting unique. That way the old file won't get overwritten. Likewise you can add the -C option to add a note to help remember what the key is for.
Code:
cd ~/.ssh/
ssh-keygen -f dt_to_laptop -C "connect to laptop from desktop" -t ed25519
ssh-keygen -f lt_to_desktop -C "connect to desktop from laptop" -t ed25519
ssh-keygen -f ph_to_laptop -C "connect to laptop from phone" -t rsa -b 4096
ssh-keygen -f ph_to_desktop -C "connect to desktop from phone" -t rsa -b 4096
Note that you can use "-t ed25519" instead of "-t rsa -b 4096" if you can handle modern keys, which would make keys using the Ed25519 algorithn. The phone might not handle those, so the above makes 4096-bit RSA for the phone just in case backward compatibility is needed. However, check with the documentation for Termius and see if it supports Ed25519 and use that instead if you can. It's not just a new algorithm, it's in a different category from RSA.
Then put the keys in place:
Code:
ssh-copy-id -i dt_to_laptop me@laptop
ssh-copy-id -i lt_to_desktop me@desktop
ssh-copy-id -i ph_to_laptop me@laptop
ssh-copy-id -i ph_to_desktop me@desktop
Then on each client you can see your key files in the directory ~/.ssh/ and on each "server" in the file ~/.ssh/authorized_keys You can use the file ~/.ssh/config in each of the client machines to make shortcuts. So on the laptop you'd have:
Code:
Host desktop
Hostname 192.168.1.126
IdentityFile ~/.ssh/lt_to_desktop
User thecoop
IdentitiesOnly yes
Then you'd only need to type "ssh desktop" on your laptop and it will connect. If you like that, do vice versa for the desktop's
ssh_config file.
Somehow you will have to get "ph_to_laptop" and "ph_to_desktop" over to the phone. You write that you have an iPhone, the
Termius app on the iphone has a lot fewer features than the Android version. It says "PuTTY" keys on the Apple page so you may have to convert the phone's keys before transferring them to the phone.