[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 680
  • Last Modified:

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'
0
rgbcof
Asked:
rgbcof
1 Solution
 
woolmilkporcCommented:
Use

ssh -tt testuser@...

wmp
0
 
rgbcofAuthor Commented:
That was an awesome solution.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now