S3 as primary via putty

Hi,
I have nextcloud installed on an EC2 instance and want to use S3 as primary storage.

From what I understand, I need to add the lines found here, to the main config.php file:
https://docs.nextcloud.com/server/15/admin_manual/configuration_files/primary_storage.html#simple-storage-service-s3

How would I do that please using putty?

I am a linux absolute beginner and managed to do the initial install with some step-by-step found on the web+ snap.

Any advice appreciated.

Many thanks,

Andy