Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-5628

man bash does not properly specify when .bashrc is sourced in a ssh connection

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Undefined Undefined
    • rhel-7.9.z
    • rhel-7.8
    • bash
    • None
    • Moderate
    • rhel-sst-cs-plumbers
    • ssg_core_services
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      Example steps to reproduce:

      $ echo 'this is .bashrc' > ~/.bashrc
      $ echo 'this is .bash_profile' > ~/.bash_profile

      $ ssh test@localhost
      ...
      this is .bash_profile

      $ ssh test@localhost whoami
      ...
      this is .bashrc

      The manual page says:

      Bash attempts to determine when it is being run with its standard
      input connected to a network connection, as when executed by the
      remote shell daemon, usually rshd, or the secure shell daemon sshd.
      If bash determines it is being run in this fashion, it reads and
      executes commands from ~/.bashrc, if that file exists and is read‐
      able.

      The manual page should reflect it is only for non interactive shells.
      Maybe should also document that if bash is built with the preprocessor
      SSH_SOURCE_BASH then it would also source .bashrc for interactive shells.

              rhn-support-svashish Siteshwar Vashisht
              rhn-support-pandrade Paulo Andrade
              Siteshwar Vashisht Siteshwar Vashisht
              Karel Volný Karel Volný
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: