mkdir -m 700 /root/.ssh
echo "my public key" > /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
restorecon -r /root/.ssh
source: https://www.centos.org/forums/viewtopic.php?t=2480
# Create a socks proxy to remote server
ssh -D 1080 -C -q -N <remote>
# Create an http proxy over socks
polipo socksParentProxy=localhost:1080
# Test the HTTP proxy
http_proxy=localhost:8123 curl http://ifconfig.co
As a result, we've two proxy servers running on localhost:
SOCKS 5 proxy localhost:1080
HTTP proxy localhost:8123
Needs OpenSSH to be installed on the system
ssh-keygen -i -f /path/to/Identity.pub > ~/.ssh/id_rsa.pub
ssh-keygen -e -f /path/to/id_rsa.pub > /path/to/Identity.pub
<user> ALL=(root) NOPASSWD: /path/to/script
pay attention to <tab> after <user>
# List configured swap files
swapon -s
# Disable all swapfiles
swapoff -a
# Create a 1GB empty file
dd if=/dev/zero of=/swapfile bs=1M count=1024
# Make that empty file a swapfile
mkswap /swapfile
# Enable swapfile for system to use
swapon /swapfile
LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | head -c${1:-32};echo
useradd -d /home/user -m -s /bin/bash user
passwd user
# disable
chsh -s /bin/false user
# change
chsh -s /bin/zsh user
printf \
"export LANGUAGE=en_US.UTF-8\n\
export LANG=en_US.UTF-8\n\
export LC_ALL=en_US.UTF-8\n" \
>> /etc/environment
Host vagrant
HostName vagrant.local
User ubuntu
Port 2222
IdentityFile /Users/refik/Sites/vagrant/xenial/.vagrant/machines/web/virtualbox/private_key