您好,登錄后才能下訂單哦!
$ cat ~/.ssh/config ServerAliveInterval 60 SendEnv NO TCPKeepAlive yes ServerAliveInterval=15 ServerAliveCountMax=6 Compression=yes ForwardAgent=yes #GSSAPIAuthentication no ControlMaster auto ControlPath /tmp/ssh_mux_%h_%p_%r Host * StrictHostKeyChecking no |
echo $SHELL
http://segmentfault.com/a/1190000000606752#articleHeader2
搜索:設置默認shell
對bash, 修改~/.bashrc, 添加
#如果是mac系統,修改添加~/.bash_profile
SSH_ENV="$HOME/.ssh/environment" function start_agent { #echo "Initialising new SSH agent..." /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" #echo succeeded chmod 600 "${SSH_ENV}" . "${SSH_ENV}" > /dev/null /usr/bin/ssh-add; } if [ -f "${SSH_ENV}" ]; then . "${SSH_ENV}" > /dev/null ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { start_agent; } else start_agent; fi |
對zsh, 修改~/.zshrc, 添加
SSH_ENV="$HOME/.ssh/environment" function start_agent { #echo "Initialising new SSH agent..." /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" #echo succeeded chmod 600 "${SSH_ENV}" . "${SSH_ENV}" > /dev/null /usr/bin/ssh-add; } if [ -f "${SSH_ENV}" ] then . "${SSH_ENV}" > /dev/null ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null if [ ! "$?" = "0" ]; then start_agent; fi else start_agent; fi |
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。