Link to home
Start Free TrialLog in
Avatar of rgbcof
rgbcof

asked on

linux, how to sudo inside of an ssh session

I am trying to ssh in to another computer, and sudo to another user (root in this case) to perform a copy, but I am getting an error.

sudo: no tty present and no askpass program specified

My command is
ssh testuser@10.39.151.172 'sudo cp ~testuser/file1 /tmp/file1'
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgbcof
rgbcof

ASKER

That was an awesome solution.