You could write it as
sudo ufw default deny & sudo ufw allow ssh & sudo ufw allow http & sudo ufw allow https & sudo ufw allow 53/tcp & sudo ufw allow 53/udp & sudo ufw allow from any port 68 to any port 67 proto udp
seperating the commands by &
.
Anyway more beautiful would be writing a script
E.g. in ~/setUp_UFW.sh
#!/bin/bash
sudo ufw default deny l
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw allow 53/tcp
sudo ufw allow 53/udp
sudo ufw allow from any port 68 to any port 67 proto udp
Make the script executable
chmod +x ~/setUp_UFW.sh
than everytime you just go
~/setUp_UFW.sh
to set it up.
(You will be asked for the sudo password when the script sees sudo the first time.)
&> /dev/null
or wrap the whole script as further explained in this answer – derHugo Oct 04 '17 at 15:14