-
-
Save ericvanjohnson/7c352755d00f3dc0be96 to your computer and use it in GitHub Desktop.
Forward Prompt to remote servers
This file contains hidden or 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