{"id":15507970,"url":"https://github.com/danrabinowitz/sshrc","last_synced_at":"2026-02-06T02:32:24.507Z","repository":{"id":20920062,"uuid":"24208035","full_name":"danrabinowitz/sshrc","owner":"danrabinowitz","description":"bring your .bashrc, .vimrc, etc. with you when you ssh","archived":false,"fork":false,"pushed_at":"2014-09-15T18:18:24.000Z","size":78,"stargazers_count":96,"open_issues_count":0,"forks_count":169,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-20T12:24:47.146Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danrabinowitz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-18T22:59:43.000Z","updated_at":"2025-06-23T12:23:34.000Z","dependencies_parsed_at":"2022-08-17T16:05:43.688Z","dependency_job_id":null,"html_url":"https://github.com/danrabinowitz/sshrc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/danrabinowitz/sshrc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danrabinowitz%2Fsshrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danrabinowitz%2Fsshrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danrabinowitz%2Fsshrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danrabinowitz%2Fsshrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danrabinowitz","download_url":"https://codeload.github.com/danrabinowitz/sshrc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danrabinowitz%2Fsshrc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29145858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T01:13:33.096Z","status":"online","status_checked_at":"2026-02-06T02:00:08.092Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T09:34:34.567Z","updated_at":"2026-02-06T02:32:24.490Z","avatar_url":"https://github.com/danrabinowitz.png","language":null,"readme":"\u003ch2\u003eInstallation\u003c/h2\u003e\n\n\u003ch3\u003eUbuntu (12.04 and 14.04 only):\u003c/h3\u003e\n    \n    $ sudo add-apt-repository ppa:russell-s-stewart/ppa\n    $ sudo apt-get update\n    $ sudo apt-get install sshrc\n\n\n\u003ch3\u003eEverything else:\u003c/h3\u003e\n    $ wget https://raw.githubusercontent.com/Russell91/sshrc/master/sshrc\n    $ chmod +x sshrc\n    $ sudo mv sshrc /usr/local/bin #or anywhere else on your PATH\n\n\u003ch2\u003eUsage\u003c/h2\u003e\n\nsshrc works just like ssh, but it also sources the ~/.sshrc on your local computer after logging in remotely.\n\n    $ echo \"echo welcome\" \u003e ~/.sshrc\n    $ sshrc me@myserver\n    welcome\n\n    $ echo \"alias ..='cd ..'\" \u003e ~/.sshrc\n    $ sshrc me@myserver\n    $ type ..\n    .. is aliased to `cd ..'\n\nYou can use this to set environment variables, define functions, and run post-login commands. It's that simple, and it won't impact other users on the server - even if they use sshrc too. This makes sshrc very useful if you share a server with multiple users and can't edit the server's ~/.bashrc without affecting them, or if you have several servers that you don't want to configure independently. For more advanced configuration, continue reading.\n\n\u003ch2\u003eAdvanced configuration\u003c/h2\u003e\n\nYour most import configuration files (e.g. vim, inputrc) may not be bash scripts. Put them in ~/.sshrc.d and sshrc will copy them to a (guaranteed) unique folder in the /tmp directory after login. You can find them on the sever at $SSHHOME/.sshrc.d\n\nOnce the config files are on the server, you can usually tell programs to load their configuration from the $SSHHOME/.sshrc.d directory by setting the right environment variables. For example, vim uses the VIM environment variable.\n\n    $ mkdir -p ~/.sshrc.d\n    $ echo ':imap \u003cspecial\u003e jk \u003cEsc\u003e' \u003e ~/.sshrc.d/vimrc\n    $ echo 'VIM=$SSHHOME/.sshrc.d' \u003e ~/.sshrc\n    $ sshrc me@myserver\n    $ vim # jk -\u003e normal mode will work\n    \nPutting too much data in ~/.sshrc.d will slow down your login times. If the folder contents are \u003e 1MB, the server may start blocking your sshrc attempts.\n\nIf you use tmux frequently, you can make sshrc work there as well.\n\n    $ echo 'SHELL=$SSHHOME/bashsshrc\n      alias tmux=\"tmux -S /tmp/russelltmuxserver\"\n      alias foo=\"echo I work with tmux, too\"' \u003e ~/.sshrc\n    $ sshrc me@myserver\n    $ tmuxrussell\n    $ foo\n    I work with tmux, too\n\nAfter the SHELL variable is set, any new tmux server will load your configurations. The -S option will start a separate tmux server at /tmp/russelltmuxserver. Don't try to access the vanilla tmux server when your SHELL environment variable is set: if the server isn't already running, other users will get your configurations with their own sessions.\n","funding_links":[],"categories":["Apps"],"sub_categories":["Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanrabinowitz%2Fsshrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanrabinowitz%2Fsshrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanrabinowitz%2Fsshrc/lists"}