At the same time as sorting out Passwordless Sudo on my Ubuntu virtual machine, I am trying to make it match my fairly default Raspberry Pi or other Linux box setup.
My default username on a Raspberry Pi is still ‘pi’, not for any real reason other than nostalgia. And because it is easy to remember. Since this virtual machine is called “Fake Raspberry Pi”, the user for it is also pi.
Some of these instructions are not required when using the Raspberry Pi Linux software natively
Basic Linux housekeeping
Before we do anything else, we will make sure the install is up to date:
$ sudo apt update
$ sudo apt dist-upgrade
$ sudo apt upgrade
$ sudo apt autoremove
$ sudo apt install git nano
Set up SSH and SSH keys
We will want to make sure SSH is up and running, allowing us to SSH into the box remotely, and set up a key that we can use for things like GitHub.
Set up Linux for SSH access.
My public key for my laptop is:
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBZXuVXuc19rqZAfSH+CzeDTP+epLlpmMvryJeuXqVO9 skippy@thrudhr.local
This needs to be saved in the file ~/.ssh/authorized_keys, because I can’t copy or paste into the virtual machine. I set up an OpenSSH Server.
$ sudo apt install ssh
Once installed, the SSH service will start automatically. However, it’s always a good idea to verify that the service is running correctly.
Set up the SSH Service to Start on Boot
To ensure the SSH service starts automatically after a reboot, use systemctl to enable it.
$ sudo systemctl enable ssh
I got the IP address using the command:
$ hostname -i
I also needed to change the network type in VirtualBox from NAT to bridged networking to log in via SSH. Logging in, I was able to paste my public key into the authorized_keys file.
SSH key
At the moment, I am using EdDSA keys by preference, the Edwards-curve Digital Signature Algorithm, it makes secure and short key pairs, as well as being quite processor-efficient.
$ ssh-keygen -t ed25519
ZSH
By preference, I use ZSH as my shell. I don’t really have in-depth knowledge of the pros and cons of the different shells available. But with Mac moving to ZSH by default and finding Oh My ZSH, which helps to theme it to my liking, it makes sense to use it everywhere for uniformity.
$ sudo apt install zsh
$ chsh -s $(which zsh)
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
$ nano ~/.zshrc
In the .zshrc file, I edit the line ZSH_THEME=“robbyrussell” to ZSH_THEME=“clean”
Linux Set up Finished?
This is most of my default setup. At some point, I will work on getting my dotfiles all into git, which should make this easier.
One thing missing from Raspberry Pi Linux at the moment is Hyfetch, which replaced the now-deprecated Neofetch.
$ sudo apt install hyfetch
$ nano ~/.zprofile
Add the following two lines:
clear
hyfetch

Why hyfetch?
I would like to know which machine I am logged into, which is why I use Hyfetch to display the OS logo, the hostname, and the user. Details such as uptime are handy to have.

2 thoughts on “My Basic Linux Setup”
What i don’t understand — why there’s such a proliferation of these ‘fetch’ tools?
How many different programs do there need to be to display a random ascii art logo
Such and such is deprecated so now there’s such and such — what was there to deprecate?
If you want information about the machine to be displayed on login, you can put it in /etc/motd rather than having to run a program from your profile.
I forgot about /etc/motd.