Difference between revisions of "Sshs"
Jump to navigation
Jump to search
(Created page with " # Wrapper for ssh to automatically source bash config file on remote machine. # Sources ~/.bashrc_remote # # author Jonah Dahlquist # license CC0 sshs() {...") |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{lc}} | |
+ | sshs [[Bash shell functions|function]] | ||
# Wrapper for ssh to automatically source bash config file on remote machine. | # Wrapper for ssh to automatically source bash config file on remote machine. | ||
Line 8: | Line 9: | ||
sshs() { | sshs() { | ||
− | ssh ${*:1} "cat > /tmp/.bashrc_temp" < ~/.bashrc_remote | + | ssh ${*:1} "cat > /tmp/.bashrc_temp" < [[~/.bashrc_remote]] |
− | ssh -t ${*:1} "bash --rcfile /tmp/.bashrc_temp ; rm /tmp/.bashrc_temp" | + | ssh [[-t]] ${*:1} "[[bash --rcfile]] /tmp/.bashrc_temp ; rm /tmp/.bashrc_temp" |
} | } | ||
+ | |||
+ | Source: https://gist.github.com/jonahbron/5549848 | ||
+ | |||
+ | |||
+ | |||
+ | == Related == | ||
+ | [[.bashrc]] | ||
+ | |||
+ | == See also == | ||
+ | * {{sshs}} | ||
+ | * {{Bash}} | ||
+ | * {{ssh}} | ||
+ | |||
+ | [[Category:IT]] |
Latest revision as of 16:19, 18 February 2024
sshs function
# Wrapper for ssh to automatically source bash config file on remote machine. # Sources ~/.bashrc_remote # # author Jonah Dahlquist # license CC0 sshs() { ssh ${*:1} "cat > /tmp/.bashrc_temp" < ~/.bashrc_remote ssh -t ${*:1} "bash --rcfile /tmp/.bashrc_temp ; rm /tmp/.bashrc_temp" }
Source: https://gist.github.com/jonahbron/5549848
Related[edit]
.bashrc
See also[edit]
- sshs
Bash [ -c ]
,alias
,&&
, Bash history, Autocompletion,set
,unset
,export
,.bash_aliases, .bashrc and .bash profile
,PS1
,echo
,brace expansion
, Function,shopt
,trap
,set -e
,source
,PATH
,complete
,disown
,.hushlogin
,.bashrc
,builtin
,eval
,set
,$PATH
,$HOME
,TZ
,.profile
,-e, -i
,Builtin (Bash)
,mapfile
,~
, return (Bash), for, until,declare, dirname, basename, functions.sh
, Bash arithmetic expansion,shift, bash --rcfile, readonly, $1, $@
- SSH:
ssh
, TLS,.ppk, .pem, .crt, .pub
, ED25519, Key exchange method (KEX), public key, private key,ssh -Q kex
,IAMUserSSHKeys
,known_hosts
, ssh tunnel, Dropbear
Advertising: