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'
SSH / Telnet SoftwareLinux

Avatar of undefined
Last Comment
rgbcof

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
woolmilkporc

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
rgbcof

ASKER
That was an awesome solution.
Your help has saved me hundreds of hours of internet surfing.
fblack61