An environment switcher for shared system accounts.
motivation
Motivation
----------
A sysadmin is more efficient with his custom tweaked environment, that includes aliases, colors, environment variables, program settings etc. Of course this does not apply for real hacker gurus in front of a green shimmering CRT screen. But some noob admins, like me, would be completely lost if vim is in compatibility mode: "Why are the arrow keys not working?". With only `/root/.bashrc` all admins need to agree on a common environment. Nobody will be completely happy with the consensus. This project tries to solve that problem.
An admin is probably more efficient and certainly much happier in his customized environment. That includes settings like aliases, colors, environment variables, program configurations etc. Of course this does not apply for real hacker gurus in front of a green shimmering CRT screen, they just need one color, that is green, and the defaults. But some noob admins, like me, don't even know how to move the cursor if vim is in compatibility mode. With only `/root/.bashrc` all admins need to agree on a common environment. Nobody will be completely happy. This project tries to solve that problem.
reserved files in main `envrcd.d`
--------------------------------
Reserved files in `envrcd.d`
----------------------------
These files should only exist locally and are ignored by git
...
...
@@ -40,7 +40,7 @@ export ENVRCD_INVENTORY="testing" # set inventory group
Create this file to set host specific settings that should override possible user settings. Useful to define host specific aliases.
basic operation
Basic operation
---------------
The script works by sending environment variables prefixed with `ENVRCD_SET_*` via SSH to the remote host. The following variables are supported:
...
...
@@ -64,7 +64,7 @@ All following files are sourced inside the profile directory in this order:
To load host specific settings place `20-host` and/or `90-host-late` in `~/.envrcd/envrcd.d/`. For example, we can set `ENVRCD_INVENTORY` to `production` or `testing` in `20-host`, which will show a different colored prompt. The default is to assume we are on a `production` system if this variable is not set.
configuration for the user (on your workstation)
Configuration for the user (on your workstation)
------------------------------------------------
Send the `ENVRCD_SET_*` environment vars in either `/etc/ssh/ssh_config` or `~/.ssh/config`:
...
...
@@ -73,7 +73,7 @@ Send the `ENVRCD_SET_*` environment vars in either `/etc/ssh/ssh_config` or `~/.
SendEnv [...] ENVRCD_SET_*
```
### minimal variant
### Minimalist variant
Export the following variables in your `~/.bashrc` for your normal account:
...
...
@@ -81,7 +81,7 @@ Export the following variables in your `~/.bashrc` for your normal account:
export ENVRCD_SET_USER="<username>"
```
### or migrate your `~/.bashrc` to `envrcd`
### Or migrate your `~/.bashrc` to `envrcd`
Setup the files:
...
...
@@ -109,7 +109,7 @@ git commit -m 'Add user <username>'
git push
```
installation for root (server)
Installation for root (server)
------------------------------
Setup the files:
...
...
@@ -127,7 +127,7 @@ Accept the `ENVRCD_SET_*` environment vars in `/etc/ssh/sshd_config`: