Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • no, result.txt is on the local machine i.e. the machine from which i'm running the command @Jesse_b Commented Feb 25, 2018 at 15:15
  • 1
    Is there any reason you are using sh -c? That isn't suggested at all in your linked question. I cannot reproduce your results though. Works fine for me using macos to centos. Commented Feb 25, 2018 at 15:19
  • It could be a issue of the host ssh. saw the sh -c solution herehttps://unix.stackexchange.com/questions/297438/capture-stdout-from-ssh-session-to-local-machine?rq=1 @Jesse_b Commented Feb 25, 2018 at 15:32
  • Do you get the same error if you run sh -c pwd or sh -c "ssh 192.168.2.202 pwd" ? Commented Feb 25, 2018 at 15:40
  • 1
    It looks like there's a problem on the remote system that's independent of ssh and redirection. Maybe the home directory or one of its parents on the remote system is denying access to the user. Or one of the mount points on the remote system is broken. Can you login to the remote system interactively without any errors? Commented Feb 25, 2018 at 22:00