Friday, 29 April 2016

ssh without passwords

One thing I’ve done quite a few times, but always have to look up how to do it as it’s a “do it once, then forget it” kind of thing.

Here’s how to do it:

  • On the client machine, run ssh-keygen
  • Once the key is created, run ssh-copy-id remoteuser@remotehost
You’ll be asked for the remoteuser password, the key is copied across, and ... that is it. You can now ssh remoteuser@remotehost and never need a password.

Friday, 22 April 2016

Ubuntu 16.04

After trialling the RC, I'm taking the plunge and doing a brand-new install of 16.04.

One thing I'm trialling is giving myself a different UID, rather than accepting the default "1000" that new users get. The main reason is for new to have the same UID on all the Linux laptops I manage, meaning things like external HDDs will "just work" for me. I've chosen 5000 as a good one, for no real reason other than I needed to pick a number over 1000 ;-)

I've started by creating a dummy admin user as part of the install, then used the User Accounts control panel to add me as an admin. Lastly, I need to set my UID before I log in:

sudo usermod -u 5000 dave
sudo groupmod -g 5000 dave

Lastly, I did an id on the admin user, and an id dave to see which groups were different. Doing

sudo usermod -a -G group name dave

for each group sorted all that. Now to log in and see what happens!