Ho una macchina Amazon EC2 con Ubuntu 10.04.BASH e/o .BASHRC non funzionano correttamente dopo l'accesso SU o SSH a meno che non si esegua il comando "bash"
L'utente predefinito, ubuntu di .bashrc
sembra comportarsi correttamente, ma se mi ssh
o su
al secondo utente, Mikey, non viene visualizzato correttamente fino a quando corro bash
:
Ex 1.) Cambiare utente con su
[email protected] ~$ ssh [email protected]
[email protected]:~$
[email protected]:~$ su mikey
$
$ bash
[email protected]: $
Ex 2.) SSH-zione direttamente come utente
[email protected] ~$ ssh [email protected]
/home/mikey/.bashrc: 13: shopt: not found
/home/mikey/.bashrc: 21: shopt: not found
/home/mikey/.bashrc: 99: shopt: not found
/etc/bash_completion: 33: [[: not found
/etc/bash_completion: 39: [[: not found
/etc/bash_completion: 52: Bad substitution
\[\e]0;\[email protected]\h: \w\a\]\[email protected]\h:\w$
\[\e]0;\[email protected]\h: \w\a\]\[email protected]\h:\w$ bash
[email protected]:~$
Ho provato a giocare con ~/.profile
e ~/.bash_login
includere
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
ma finora, nulla è sembrato fare il trucco.
qualsiasi suggerimento sarebbe molto apprezzato. Grazie!
Puoi 'echo $ SHELL' dalla shell non funzionante? È possibile (e probabilmente, basato sul solitario '$') che non è 'bash'. –
Grazie, sei esattamente corretto. \ [\ e] 0; \ u @ \ h: \ w \ a \] \ u @ \ h: \ w $ echo $ SHELL /bin/sh Googling ora per vedere come cambiare la situazione, ma qualsiasi suggerimento sarebbe apprezzato. :) – Mikey
Vedi sotto per un esempio usando 'usermod'. –