[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ssh does not source /etc/bash.bashrc, but manual execution of /bin/bash
From: |
Nick |
Subject: |
ssh does not source /etc/bash.bashrc, but manual execution of /bin/bash does it under specific circumstances |
Date: |
Tue, 20 Dec 2016 19:11:17 +0300 (MSK) |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='$
uname output: Linux katastrofi 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2
(2016-10-19) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 4.3
Patch Level: 30
Release Status: release
Description:
Hello,
i came up with a weird behavior of ssh+bash on my Debian box (8.6).
I created an alias in /etc/bash.bashrc file, which is sourced through
/etc/profile.
Everything worked fine, till i decided to remove the '.
/etc/bash.bashrc' line from /etc/profile.
When i` m connected via ssh the '/etc/bash.bashrc' is not sourced and
the alias does not work as expected.
But, when i execute bash from my shell, the '/etc/bash.bashrc' seems to
be sourced and the alias is there (please find bellow a demo)
Not sure if i miss something (f.x. bash is executed with different
flags while being called from ssh versus a user), but as far as i understand,
the same things should be (or not) sourced.
Best,
Nick
Please find /etc/bash.bashrc, /etc/profile and my home directory under
this link: www.katastrofi.eu/nick.tar.gz
# Demo
root@RBMK-1000:~# ssh nick@10.250.251.12
ssh nick@10.250.251.12
nick@10.250.251.12's password:
The programs included with the Debian GNU/Linux system are free
software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Dec 20 17:29:37 2016 from 10.250.251.238
bla
nick@RBMK-1000:~$ ll
-bash: ll: command not found
nick@RBMK-1000:~$ bash
nick@RBMK-1000:~$ ll
total 24
drwxr-xr-x 2 nick nick 4096 Dec 20 17:28 .
drwxr-xr-x 3 root root 4096 Dec 13 22:06 ..
-rw------- 1 nick nick 195 Dec 20 17:29 .bash_history
-rw-r--r-- 1 nick nick 220 Nov 4 12:58 .bash_logout
-rw-r--r-- 1 nick nick 3515 Nov 4 12:58 .bashrc
-rw-r--r-- 1 nick nick 675 Nov 4 12:58 .profile
nick@RBMK-1000:~$
# nick login shell
nick@katastrofi:~$ grep nick /etc/passwd
nick:x:1000:1000:,,,:/home/nick:/bin/bash
nick@katastrofi:~$
# OS
nick@RBMK-1000:~$ uname -a
Linux RBMK-1000 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2
(2016-10-19) x86_64 GNU/Linux
nick@RBMK-1000:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.6 (jessie)
Release: 8.6
Codename: jessie
nick@RBMK-1000:~$
# Packages installed
nick@RBMK-1000:~$ dpkg -l | grep bash
ii bash 4.3-11+b1 amd64
GNU Bourne Again SHell
ii bash-completion 1:2.1-4 all
programmable completion for the bash shell
nick@RBMK-1000:~$ dpkg -l | grep ssh
ii libssh2-1:amd64 1.4.3-4.1+deb8u1 amd64
SSH2 client-side library
ii openssh-client 1:6.7p1-5+deb8u3 amd64
secure shell (SSH) client, for secure access to remote machines
ii openssh-server 1:6.7p1-5+deb8u3 amd64
secure shell (SSH) server, for secure access from remote machines
ii openssh-sftp-server 1:6.7p1-5+deb8u3 amd64
secure shell (SSH) sftp server module, for SFTP access from remote machines
ii python-paramiko 1.15.1-1 all
Make ssh v2 connections with Python (Python 2)
ii task-ssh-server 3.31+deb8u1 all
SSH server
nick@RBMK-1000:~$
- ssh does not source /etc/bash.bashrc, but manual execution of /bin/bash does it under specific circumstances,
Nick <=