If you have accidentally deleted /dev partition then you will face issues in ssh for sure, so you may try the following fixes via console so that ssh may start.
Try restarting sshd
if you receive the following output
/dev/null no such file or directory
ls -al null
ls: cannot access null: No such file or directory
then you need to create one.
mknod /dev/null c 1 3
chmod 666 /dev/null
PRNG is not seeded
means your urandom file not present now, you need to create it
ls -al /dev/urandom
ls: cannot access /dev/urandom: No such file or directory
mknod /dev/urandom c 1 9
now restart sshd.
Stopping sshd: [ OK ] Starting sshd: [ OK ]
Cool, your sshd is now restarted, however when you login via ssh you may receive the following error and cannot access the server’s commandline.
login as: root email@example.com's password: Server refused to allocate pty
So, now you need to create pty and tty by the following command.
/sbin/MAKEDEV pty /sbin/MAKEDEV tty
now you will be able to access server via ssh. 🙂