share
Unix & LinuxHex edit over SSH
[0] [1] Ollie
[2020-04-14 19:08:31]
[ ssh hex ]
[ https://unix.stackexchange.com/questions/580071/hex-edit-over-ssh ]

How can you hex edit a file over SSH? I have tried using hexedit, but it says command not found. Using xxd gives the hex dump of the file, but how can I actually edit the file?

[0] [2020-04-14 19:16:58] Eduardo Trápani [ACCEPTED]

hexedit [1] should do it.

hexedit shows a file both in ASCII and in hexadecimal. The file can be a device as the file is read a piece at a time. You can modify the file and search through it.

Alternatively, you can use vim and xxd to do the same. Check this answer How to edit binary files with Vim? [2].

[1] https://linux.die.net/man/1/hexedit
[2] https://vi.stackexchange.com/questions/343/how-to-edit-binary-files-with-vim

then do sudo apt-get install hexedit (or whatever command your remote system uses to install software). - Eduardo Trápani
I can't do that either, it says 'sudo: command not found', sorry again! - Ollie
You could also use vim. But if you don't have it either ... I'm out of ideas. - Eduardo Trápani
Oh thanks for the help, I can use Vim and also Nano to edit the file. I also managed to install hexedit using wget. - Ollie
1