[Bug 345570] New: .bashrc is not sourced after ssh -t
https://bugzilla.novell.com/show_bug.cgi?id=345570 Summary: .bashrc is not sourced after ssh -t Product: openSUSE 10.2 Version: Final Platform: PowerPC-64 OS/Version: openSUSE 10.2 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: vincent@vinc17.org QAContact: qa@suse.de Found By: --- When I run a command with "ssh -t <openSUSE_host> <command>", the .bashrc file is not sourced. This problem doesn't occur without the -t option (or with Debian machines). doublejack:~> cat /etc/SuSE-release openSUSE 10.2 (PPC) VERSION = 10.2 doublejack:~> ssh -t doublejack echo \$PATH /usr/bin:/bin:/usr/sbin:/sbin doublejack:~> ssh doublejack echo \$PATH /home/vlefevre/bin:/home/vlefevre/ppc64/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11R6/bin:/opt/bin:. doublejack:~> strings -a =sshd | grep usr/sbin /usr/bin:/bin:/usr/sbin:/sbin As you can see, with the -t option, I just get the $PATH defined by sshd (not the $PATH redefined in my .bashrc). The bash(1) man page says: Bash attempts to determine when it is being run by the remote shell daemon, usually rshd. If bash determines it is being run by rshd, it reads and executes commands from ~/.bashrc, if that file exists and is readable. It will not do this if invoked as sh. The --norc option may be used to inhibit this behavior, and the --rcfile option may be used to force another file to be read, but rshd does not generally invoke the shell with those options or allow them to be specified. "ssh -t doublejack echo \$SHELL" outputs /bin/bash, so the shell has been invoked as bash (not sh). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=345570 Mark Gordon <mtgordon@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtgordon@novell.com, werner@novell.com AssignedTo|bnc-team-screening@forge.provo.novell.com |anicka@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=345570 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=345570#c1 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anicka@novell.com AssignedTo|anicka@novell.com |werner@novell.com Severity|Normal |Enhancement Status|NEW |ASSIGNED Component|Basesystem |Basesystem Product|openSUSE 10.2 |openSUSE 11.0 Platform|PowerPC-64 |All Target Milestone|--- |Alpha 1 Version|Final |unspecified --- Comment #1 from Dr. Werner Fink <werner@novell.com> 2007-12-04 03:49:33 MST --- IMHO the bash on debian is hacked ... in other words this bash does *not* follow the standard behaviour. See: I've added the line test $(id -un) = werner && echo $BASH_SOURCE to the files ~/.bashrc, /etc/bash.bashrc, and /etc/profile, after this I've executed /suse/werner> ssh magellan 'printenv PATH' /etc/bash.bashrc /suse/werner/.bashrr /suse/werner/bin:/suse/werner/bin/x86_64:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/opt/kde3/bin:/opt/gnome/bin and then /suse/werner> ssh -t magellan 'printenv PATH' /usr/bin:/bin:/usr/sbin:/sbin as you can see even the system files are not sourced and this is the default for the bash. IMHO this is not a bug ... you may see it as enhencement but nevertheless the common behaviour of the bash has to be changed for this. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=345570 User vincent@vinc17.org added comment https://bugzilla.novell.com/show_bug.cgi?id=345570#c2 --- Comment #2 from Vincent Lefevre <vincent@vinc17.org> 2007-12-04 05:36:34 MST --- Indeed the upstream http://tiswww.case.edu/php/chet/bash/CHANGES file says: [...] This document details the changes between this version, bash-2.05a-rc1, and the previous version, bash-2.05a-beta1. [...] z. Bash no longer attempts to discover if it's being run by sshd in order to run the startup files. If the SSH_SOURCE_BASHRC is uncommented in config-top.h it will attempt to do so as previously, but that's commented out in the distributed version. This is also mentioned in http://tiswww.case.edu/php/chet/bash/COMPAT (change 17). and Debian's README.Debian.gz file contains: - try to check whether bash is being run by sshd and source the .bashrc if so (like the rshd behavior). Now, the bash man page doesn't reflect the upstream behavior (sshd is the remote shell daemon nowadays). And this doesn't explain why there's a visible difference between "ssh <host> <cmd>" and "ssh -t <host> <cmd>", concerning this point. I've just sent a mail to bug-bash about this point. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=345570 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=345570#c3 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #3 from Dr. Werner Fink <werner@novell.com> 2007-12-04 08:46:36 MST --- I've enabled the SSH_SOURCE_BASHRC define -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com