Are you able to ssh
to the server? Are you able to sudo
to the root user? What can you run via sudo
?
Backing up the data will be easy if you can run sudo /bin/bash
, for example, then use rsync
to take a copy. Even better would be to take file system dumps using dump
or zfs send
for example. You can take block level backups using dd
.
If you have physical access to the server, be it a recovery mode via Joyent, or being able to boot install media, then you can edit the /etc/shadow file. This is by far the simplest thing to do if possible. Once you edit /etc/shadow copy the crypt string from a user you know over the root user crypt string. For example:
root:$6$YPBAiH9m$Kf9euZx0JLKo6M51SIk1lQ1tjUajETECta/eB8dLTWEfPF1NncM7ebQrnPu7ExwqnZ130VcWyvRI21d8GlmyY/:16392:0:99999:7:::
ed:$6$zg0pHyXY$y6EriYDZCh4zrz1kztlxG2Fpf.8pmh9ON0fkoaSlW2jBJXfizrlBwGV4CFntwWsE55FKvuNlCS5UCpC1f2sio1:16392:0:99999:7:::
So, I know the password for ed, I'm just going to make root's look the same:
root:$6$zg0pHyXY$y6EriYDZCh4zrz1kztlxG2Fpf.8pmh9ON0fkoaSlW2jBJXfizrlBwGV4CFntwWsE55FKvuNlCS5UCpC1f2sio1:16392:0:99999:7:::
ed:$6$zg0pHyXY$y6EriYDZCh4zrz1kztlxG2Fpf.8pmh9ON0fkoaSlW2jBJXfizrlBwGV4CFntwWsE55FKvuNlCS5UCpC1f2sio1:16392:0:99999:7:::
See, so in effect, this is the easiest thing you can do, as you'll be setting the root password the same as a user that you know the password of.