Note: These are currently rather my personal notes on setting up an Ubuntu 20 VM from scratch.
- setup 24-hour time
sudo apt update && sudo apt upgrade
sudo apt install openssh-server
sudo systemctl status ssh
Note! Before changing hostname in Settings > About, ensure that /etc/hosts contains the
entry 127.0.1.1 some-new-hostname
. Otherwise, a lot of commands will stop working (incl. sudo
).
- ensure /etc/hosts contains the entry with the new hostname
- type
sudo nano /etc/hosts
- add
127.0.1.1 ubuntu20-ros
- save and exit (Ctrl-O Ctrl-X)
- type
- change hostname to
ubuntu20-ros
in Settings > About sudo reboot
- add the following Host specific config to
~/.ssh/config
(with useful settings)# ROS Host ubuntu20-ros User pokusew # no need to define IP address here # as ubuntu20-ros is defined in /etc/hosts # BUT when there is no internet access ubuntu20-ros in /etc/hosts does not work for ssh HostName 192.168.182.136 AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/ubuntu20_ros_rsa # DISPLAY=:0 is for running GUI on the remote display # for mutplie env vars use # SetEnv ENV1=val1 ENV2=val2 ENV3=val3 ... SetEnv DISPLAY=:0 POWERLINE_UPDATE_TERMINAL_CWD=1
- generate a new SSH key
ssh-keygen -t rsa -b 4096 -C "pokusew@ubuntu20-ros"
- transfer the key to the remote machine (will prompt for the login password)
ssh-copy-id -i ~/.ssh/ubuntu20_ros_rsa.pub ubuntu20-ros
HSTR is great replacement for standard Bash Ctrl-R reverse search feature.
Install via apt:
sudo add-apt-repository ppa:ultradvorka/ppa
sudo apt update
sudo apt install hstr
No-need for configuration now. It will be done in the next step. Read below.
Follow https://docs.ros.org/en/foxy/Installation/Linux-Install-Debians.html
It copies and configures:
- rh.sh – a simple helper to make working with ROS easier
- (TODO: fix add link once published) pokusew-bash-powerline.sh
~/.bashrc
(fully setup ROS, rh, HSTR and more)~/.tmux.conf
/etc/ssh/sshd_config
(only whenupload.sh --all
option is used, see below)- see contents of upload.sh script for more info
Run in the root of this project (ros-setup
) on your local machine:
./scripts/upload.sh v20 ubuntu20-ros --all
You will be prompted to enter your sudo password on the remote machine
(only if using --all
option that attempts to change /etc/ssh/sshd_config
).
Then, restart SSH service on the remote machine (so the /etc/ssh/sshd_config
takes effect):
ssh ubuntu20-ros "sudo -S systemctl restart ssh"