Skip to content

Instantly share code, notes, and snippets.

@Kindari
Created January 13, 2016 21:29
Show Gist options
  • Save Kindari/8fe572e733e6b1c6cab0 to your computer and use it in GitHub Desktop.
Save Kindari/8fe572e733e6b1c6cab0 to your computer and use it in GitHub Desktop.
Forward Prompt to remote servers
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