24

I want to run htop over ssh - but launch it automatically on a keyboard-less system with a shell script. My first idea was

ssh user@test.home 'htop'

but:

Error opening terminal: unknown.

Is there any way to start htop remote without typing the command every connection?

Thanks in advance!

wb7
  • 365
  • 1
  • 2
  • 7

1 Answers1

31

Use the -t flag with SSH:

ssh user@test.home -t 'htop'

This will force a TTY allocation (ssh doesn't allocate a TTY if it's not necessary, normally only for interactive shells).

mtak
  • 17,262