I use a commercial backup server to which I can copy and access files with scp, rsync and some other ways. I can also do ssh USER@SERVER COMMAND for some commands, like ls, quota, rm etc., but I am not allowed to start an interactive shell with ssh. Actually what happens if I do just ssh USER@SERVER without COMMAND is that it gives some output and then waits for EOF and then quits.

It would be really nice to be able to access files on that server with Tramp in Emacs, but I don't get it to work, because even if I use methods like scp or rsync Tramp will also try to start an ssh session and then it gets stuck waiting for that EOF. (If I break it then I can see that failed communication in the buffer *code-conversion-work*.)

Is there a way to use Tramp without an interactive shell? I think it would be possible for it to do what it needs to do with individual (allowed) commands, like ls, even though of course it would be less efficient to start a new session each time. But are there provisions for such a thing?

1 Answer 1


Tramp's ssh and scp methods call several commands on the remote side, it would be hard to identify all of them, and to allow them individually.

An alternative would be to use Tramp's sftp method. This requires that you have installed gio on your local machine, which is the case for all Linux machines, roughly said.

  • Strangely enough /sftp:USER@HOST: in Emacs shows an empty directory, not the same contents as what I see with sftp USER@HOST in the shell followed by ls to the sftp> prompt.
    – pst
    Commented Apr 11 at 21:44
  • 1
    In this case I recommend you to show this sftp problem on the Tramp ML [email protected]. Commented Apr 12 at 7:13
  • Thanks for the suggestion! I have discovered that by including a tilde, /sftp:USER@HOST:~ (or writing the explicit path to my home directory there) I can look at my files. (For some reason I can't open just ~, but subdirectories work with dired, and files work, so this is good enough for me, so thanks for suggesting to use sftp.
    – pst
    Commented Apr 15 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.