Pages

Tuesday, January 13, 2015

Do command when logged in from certain ips using ssh

$ if [ "${SSH_CLIENT%% *}" == "ipaddr" ]; then command; fi

Place in ~/.bashrc


If you login to a ssh server from different ips, sometimes you want to do something specific for each.


e.g., quickly go into screen -x session from a phone, but not your desktop.




commandlinefu.com


by David Winterbottom (codeinthehole.com)






from All commands http://ift.tt/1AN7tnL

No comments:

Post a Comment