[Bug 3883] New: /etc/profile is always executes
bugzilla-daemon at mindrot.org
bugzilla-daemon at mindrot.org
Sat Oct 18 00:59:41 AEDT 2025
https://bugzilla.mindrot.org/show_bug.cgi?id=3883
Bug ID: 3883
Summary: /etc/profile is always executes
Product: Portable OpenSSH
Version: 9.9p1
Hardware: Other
OS: Linux
Status: NEW
Severity: major
Priority: P5
Component: sshd
Assignee: unassigned-bugs at mindrot.org
Reporter: butirsky at gmail.com
That is, even for non-login and non-interactive shells.
According to man bash, /etc/profile can only be executed for login
shell.
To reproduce:
- on server, place something to /etc/profile[.d/*] file which produces
error or output
- on client, try to connect with any non-interactive command.
In my case:
$ ssh server tty
/etc/profile.d/aaa.sh: line 1: [: too many arguments
not a tty
So we see /etc/profile.d/aaa.sh is actually executed, while it
shouldn't.
I couldn't reproduce the problem by manually run "bash -c ..." command,
which makes me think it might be SSH issue.
--
You are receiving this mail because:
You are watching the assignee of the bug.
More information about the openssh-bugs
mailing list