Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
Write a file with dd over ssh

I want to write a .img file to a hdd over ssh.

Host A want to execute dd to write the img file to /dev/sda . The dd file is located at Host B.

How should the command look like?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Something like:

(from hosta) ssh hostb cat /the/file.img | dd of=/dev/sda

or

(from hostb) ssh hosta dd of=/dev/sda < /the/file.img

With ssh (and rsh before it) the I/O redirection happens on the local host unless you quote it to pass it through to the remote host. Compare these three commands (in all cases the date command runs on rmthost), but:

ssh rmthost date > /tmp/thedate                    ! local file written
ssh rmthost 'date > /tmp/thedate'                  ! remote file written
ssh rmthost date '>' /tmp/thedate                  ! remote file written
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!