Created
January 13, 2016 21:29
-
-
Save Kindari/8fe572e733e6b1c6cab0 to your computer and use it in GitHub Desktop.
Forward Prompt to remote servers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SSH_FORWARD_PROMPT=true | |
export PS1="\n[\[\e[32m\]\t\[\e[m\] \[\e[31m\]\u\[\e[m\]@\[\e[36m\]\H\[\e[m\]][\[\e[32m\]\$?\[\e[m\]]\[\e[33m\]\`/usr/sbin/getenforce\`\[\e[m\]\n\w:\!> " | |
function ssh_forward_prompt() | |
{ | |
env ssh -A "$@" -t "PS1='$PS1' bash -l" | |
} | |
if [ "$SSH_FORWARD_PROMPT" = true ] ; then | |
alias ssh="ssh_forward_prompt" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment