This isn't quite right - what if the user gives you `~/../../~/.ssh/authorized_keys`? This code will resolve it to `/home/core/../../~/.ssh/authorized_keys`, which won't be usable.