Tips and tricks: Difference between revisions

From DWIKI
(Created page with "=Clone disk over ssh= On remotehost: *have a user 'someuser' you can ssh to with key, so without password. add a line "someuser ALL=(ALL) NOPASSWD: /bin/dd Then you can run...")
 
mNo edit summary
Line 1: Line 1:
=Clone disk over ssh=
=Clone disk over ssh=
On remotehost:
On remotehost:
*have a user 'someuser' you can ssh to with key, so without password.
*have a user 'someuser' you can ssh to with key, so without password. This user must NOT be in wheel/sudoers/admin group!!!
add a line "someuser ALL=(ALL) NOPASSWD: /bin/dd
add a line "someuser ALL=(ALL) NOPASSWD: /bin/dd



Revision as of 14:39, 25 August 2016

Clone disk over ssh

On remotehost:

  • have a user 'someuser' you can ssh to with key, so without password. This user must NOT be in wheel/sudoers/admin group!!!

add a line "someuser ALL=(ALL) NOPASSWD: /bin/dd

Then you can run

ssh -t someuser@remotehost "dd if=/dev/sdXX" | dd of=/dev/sdXY


Note the "-t" which is required, otherwise you get "sudo: no tty present and no askpass program specified"