You can just re-install Ubuntu but your question is rather unclear as it's missing details.
Re-installation doesn't require the old passwords, as your new passwords will replace the old (system directories get erased so old passwords will be deleted), HOWEVER if you used encryption all data will be lost.
You can install without loosing any data; just manually select existing partitions (ie. use Something-else/Manual/Manual Partitioning), ensure they are not selected for format, and the install process will
- note packages you have manually installed
- erase system directories
- install new system
- add back the additional packages you had added to your system (if available for your new release from Ubuntu repositories)
- ask you to reboot
No user file is touched unless you selected 'format'.
This assumes a desktop system (server programs often store config files in system directories; those are lost), and no encryption is involved. This process can be done with encrypted disks too, however you'll need to know the keys or else format (thus loosing data).
This will allow you to use a supported system, instead of your EOL 17.04 system