Here is a quickstep upgrade wordpress in AWS EC2 Ubuntu without FTP.
Restart your NGINX and PHP-FPM just in case
1. Download the latest code
cd ~/ wget -c https://wordpress.org/latest.zip
2. Go to your wordpress folder
mv wp-includes ~/backup/
mv wp-admin ~/backup/
mv wp-settings.php ~/backup/
3.Update the wp-includes, wp-admin and wp-settings.php
cp -dR ~/wordpress/wp-includes .
cp -dR ~/wp-admin .
cp -dR ~/wp-settings.php .