ssh -t username@remote-server 'sudo your_command'
Just remote like usually, but using "-t" as SSH option. If you have custom SSH port, you can modify command above like this,
ssh -p your_custom_port -t username@remote-server 'sudo your_command'
Example,
ssh -t test@testserver.com 'sudo init 0'
Or,
ssh -p 2222 -t test@testserver.com 'sudo init 0'
No comments:
Post a Comment