Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7975007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:31:55+00:00 2026-06-04T08:31:55+00:00

I am trying to use Emacs TRAMP to access files over ssh on a

  • 0

I am trying to use Emacs TRAMP to access files over ssh on a server that does not provide /bin/sh, and so I get the following error when I try to connect:

env: can't execute '/bin/sh': No such file or directory

Is there any way to tell TRAMP where the remote shell is for that server? (The “server” is a tethered Android phone, so sh in at /system/bin/sh.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:31:57+00:00Added an answer on June 4, 2026 at 8:31 am

    See also the docstring for the tramp-methods variable. This part would appear noteworthy:

    • tramp-remote-shell
      This specifies the shell to use on the remote host. This
      MUST be a Bourne-like shell. It is normally not necessary to
      set this to any value other than “/bin/sh”: Tramp wants to
      use a shell which groks tilde expansion, but it can search
      for it. Also note that “/bin/sh” exists on all Unixen,
      this might not be true for the value that you decide to use.
      You Have Been Warned.

    Edit:

    So here’s a way you could create a new method based on an existing one (“scpc” in this example), and then give the custom method a different remote shell:

    (require 'tramp)
    (let* ((base-method (cdr (assoc "scpc" tramp-methods)))
           (new-method (copy-tree base-method))
           (rshell (assq 'tramp-remote-shell new-method)))
      (setcdr rshell "/system/bin/sh")
      (add-to-list 'tramp-methods (cons "android" new-method)))
    

    Note that in Emacs 23 (Tramp 2.1.20), this property was named tramp-remote-sh. In Emacs 24 (Tramp 2.2.3-24.1) it has been changed to tramp-remote-shell.

    And I’m guessing that you can use this method by default for your specified host with this:

    (add-to-list
     'tramp-default-method-alist
     (list "\\`myhost\\'" nil "android"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use gdb with emacs. The library that I'm trying to debug
I'm trying to figure out how to use Emacs Code Browser (ECB) and one
I'm trying to use ack-grep as a replacement for grep + find in Emacs
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
From the get go: sorry if I'm not using the proper emacs terminology --
I have been trying to use emacs as a python IDE, I have tried
I'm trying to use C-h c in emacs to figure out what a key
I've been trying to get into emacs lately, and one of the things I
I'm trying to change the key maps in Emacs (for use with cscope). Cscope
I am very new to emacs, I am trying to get a directory tree.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.