2.5 KiB
2.5 KiB
BashConfig
Content
Project description
Bash config files
SSH
Create ssh key on local device
ssh-keygen- Save to
~/.ssh - Enter passphrase
- Copy content of
~/.ssh/id_rsa.pubkey to remote~/.ssh/authorized_keys
Add aliases for ssh to ~/.ssh/config:
Host host_name
HostName ip
Port 22
User root
IdentityFile ~/.ssh/id_rsa
Using aliases:
ssh host_name
sftp host_name
White and black lists
add white list to /etc/hosts.allow:
sshd: 10.83.33.77/32, 10.63.152.9/32, 10.12.100.11/28, 10.82.192.0/28
add black list to /etc/hosts.deny:
sshd: ALL
Tips
/command - without using alias
Bash
| Command | Description |
|---|---|
Alt + . Esc + . |
Last object |
Ctrl + r |
Search by bash_history |
Ctrl + l |
Clear, like command clear |
Vim
| Command | Description |
|---|---|
Ctrl + [ |
Analog Esc |
d -> Ctrl + End |
Delete from cursor to end of file |
u |
Undo |
Ctrl + r |
Redo |
22G |
Go to line 22 |
Update .bashrc .bash_aliases by ssh
ssh hosting 'rm -rf ~/BashConfig; git clone https://github.com/TheK4n/BashConfig && cp BashConfig/.bash* ~; rm -rf ~/BashConfig'
Autostart
- create
/etc/systemd/system/<service>.service
sudo vim /etc/systemd/system/<service>.service
sudo systemctl daemon-reload
sudo systemctl start <service>.service
sudo systemctl status <service>.service
sudo systemctl enable <service>.service
