Scripts for setting up development environment on Debian machine, so it's possible to code from any machine with SSH client
One needs to configure user account and ssh to proceed:
adduser {user}
run visudo and add following entry below root permissions: $USER ALL=(ALL) NOPASSWD:ALL
sudo nano /etc/security/limits.conf
* hard maxsyslogins 1
sudo nano /etc/ssh/sshd_config
search for ClientAliveInterval
, if found set to 0
restart server or sudo systemctl reload sshd.service
sudo hostname {target hostname}
sudo nano /etc/hosts
- replace old hostname references with the new one
to change visudo editor type 'sudo update-alternatives --config editor'
mkdir -p ~/.ssh chmod 700 ~/.ssh touch ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys
edit /etc/ssh/sshd_config file and specify #Port different than 22
edit /etc/ssh/sshd_config file and disable root login #PermitRootLogin no
run puttygen, generate ssh key, save it, copy content to authorized_keys
if using putty, remember to specify user explicitly (not via prompt)
ssh-keygen -t rsa
ssh-copy-id user@host
alias vps='ssh user@host -p {ssh_port}' in .bashrc
sudo dpkg-reconfigure tzdata
ssh -o TCPKeepAlive=yes -o ServerAliveCountMax=20 -o ServerAliveInterval=15 -q -L 3000:localhost:3000 -l {login-name} -p {port} -i {path-to-ssh-key} {vps-url}
-L 3000:localhost:3000
parameter is for port-forwarding to enable development. Ensure that sshd_config contains AllowTcpForwarding yes
First run apt-get update
then
bash -c "$(wget -O - https://raw.githubusercontent.com/sobanieca/env-setup/master/env-setup.sh)"
bash -c "$(wget -O - https://raw.githubusercontent.com/sobanieca/env-setup/master/termux.sh)"
Proot-distro has some bash init script which explicitly sets TERM variable under:
./profile.d/termux-proot.sh:export TERM=xterm-256color
This line needs to be removed as it's not compatible with tmux
.
On WSL one may want to enable systemd. To do this, create /etc/wsl.conf
file with content:
[boot]
systemd=true
For termux font should be installed as part of termux.sh
script. For other terminals (like Windows Terminal) install
Inconsolata Go font from https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/InconsolataGo.zip
Source: Nerd fonts
Add following to .bashrc file:
source /usr/share/doc/fzf/examples/completion.bash
If any issues occur run apt-cache show fzf
for details on how to enable fuzzy autocompletion.
Use earlier steps to generate ssh key and upload it to remote machine.
In .bashrc
file append following:
export REMOTE_SSH_CONFIG_PATH="/home/{users}/remote-config.json"
Inside json file provide following structure:
{
"server": "{server}"
"username": "{user}",
"port": "{port}",
"keyPath": "~/.ssh/id_rsa",
"portForward": "3000,4000"
}
Run remote
tool to connect to remote ssh server.
To view various notes about tools defined in this repository go here