sudo apt install flameshot
sudo apt-get install scrot
scrot
scrot myimage.png
A timestamped screenshot will be written to current directory.
A screenshot will be written to myimage.png in current directory.
scrot -s myimage.png
Use mouse to make selection.
scrot -u
scrot -u -d5
Will screenshot current window (likely your ssh terminal)
As above but gives you 5 seconds to focus on correct window
Although an excellent tool, Shutter is no longer maintained and doesn't fully work (no edit functionality) in Ubuntu 18.4 without workarounds. Consider one of the alternative tools.
sudo apt remove shutter