[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] How to figure out what files has been loaded by bash?
From: |
Eduardo A . Bustamante López |
Subject: |
Re: [Help-bash] How to figure out what files has been loaded by bash? |
Date: |
Sun, 4 Jan 2015 13:33:44 -0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
You can also run:
ssh -t ... 'bash --norc --noprofile -i'
(or ssh -t ... 'bash --norc --noprofile -l', since IIRC ssh spawns a login
shell)
So that it doesn't load any file. And then you can debug it inside the remote
host.
It might also be a good idea to strace it, if using GNU/Linux:
| address@hidden ~ % ssh -t HOST 'strace -o /tmp/s -e open bash -i'
| address@hidden ~]$ exit
| Connection to HOST closed.
| address@hidden ~ % ssh HOST 'cat /tmp/s'
| open("/etc/ld.so.cache", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libtinfo.so.5", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3
| open("/dev/tty", O_RDWR|O_NONBLOCK) = 3
| open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
| open("/proc/meminfo", O_RDONLY) = 3
| open("/etc/nsswitch.conf", O_RDONLY) = 3
| open("/etc/ld.so.cache", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libnss_compat.so.2", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libnsl.so.1", O_RDONLY) = 3
| open("/etc/ld.so.cache", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libnss_nis.so.2", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libnss_files.so.2", O_RDONLY) = 3
| open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
| open("/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 3
| open("/etc/bash.bashrc", O_RDONLY) = -1 ENOENT (No such file or
directory)
| open("/home/dualbus/.bashrc", O_RDONLY) = 3
| open("/home/dualbus/.bash_history", O_RDONLY) = 3
| open("/home/dualbus/.bash_history", O_RDONLY) = 3
| open("/lib/terminfo/r/rxvt-unicode", O_RDONLY) = 3
| open("/etc/inputrc", O_RDONLY) = 3
vs:
| address@hidden ~ % ssh -t HOST 'strace -o /tmp/s -e open bash --norc
--noprofile -i'
| bash-4.2$ exit
| Connection to HOST closed.
| address@hidden ~ % ssh HOST 'cat /tmp/s'
| open("/etc/ld.so.cache", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libtinfo.so.5", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3
| open("/dev/tty", O_RDWR|O_NONBLOCK) = 3
| open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
| open("/proc/meminfo", O_RDONLY) = 3
| open("/etc/nsswitch.conf", O_RDONLY) = 3
| open("/etc/ld.so.cache", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libnss_compat.so.2", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libnsl.so.1", O_RDONLY) = 3
| open("/etc/ld.so.cache", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libnss_nis.so.2", O_RDONLY) = 3
| open("/lib/x86_64-linux-gnu/libnss_files.so.2", O_RDONLY) = 3
| open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
| open("/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 3
| open("/home/dualbus/.bash_history", O_RDONLY) = 3
| open("/home/dualbus/.bash_history", O_RDONLY) = 3
| open("/lib/terminfo/r/rxvt-unicode", O_RDONLY) = 3
| open("/etc/inputrc", O_RDONLY) = 3