Compare commits
11 Commits
410e4ef660
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3456943fda | |||
| 7c3fb9179e | |||
| d79ea8f0aa | |||
| 62ec28d00d | |||
| fe3152586b | |||
| 8c3931391c | |||
| d2f2d325d9 | |||
| 399f0f2eaf | |||
| 942144939d | |||
| 2b1a1e91dd | |||
| e9332f5162 |
59
README.md
59
README.md
@@ -3,6 +3,8 @@
|
||||
В репозитории собраны некоторые конфигурационные файлы для комфортной работы в консоли GNU Linux
|
||||
|
||||
- [Первоначальная настройка GNU Linux после установки](#первоначальная-настройка-gnu-linux-после-установки)
|
||||
- [SSH ключ для подключения](#ssh-ключ-для-подключения)
|
||||
- [Конфиг ssh клиента](#конфиг-ssh-клиента)
|
||||
- [Автонастройка](#автонастройка)
|
||||
- [Ручная настройка](#ручная-настройка)
|
||||
- [Tmux](#tmux)
|
||||
@@ -18,6 +20,60 @@
|
||||
- [Настройка](#настройка)
|
||||
- [Aliases](#aliases)
|
||||
|
||||
## SSH ключ для подключения
|
||||
|
||||
```shell
|
||||
mkdir ~/.ssh
|
||||
echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL/KY33g1maVDH80bsrfV1bHjkfiYXHu9Xtl3kJc7ofk artem@da2001.ru' >> ~/.ssh/authorized_keys
|
||||
chmod 700 ~/.ssh
|
||||
chmod 600 ~/.ssh/authorized_keys
|
||||
```
|
||||
|
||||
## Конфиг ssh клиента
|
||||
|
||||
```shell
|
||||
tee ~/.ssh/config<<EOF
|
||||
Host 10.1.*
|
||||
User da2001
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile /dev/null
|
||||
|
||||
Host bastion_local
|
||||
Hostname 192.168.13.10
|
||||
User da2001
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile /dev/null
|
||||
|
||||
Host docker
|
||||
Hostname 192.168.13.7
|
||||
User da2001
|
||||
|
||||
Host *.qwarta.ru
|
||||
ForwardAgent yes
|
||||
User adolgiy
|
||||
#User root
|
||||
IdentityFile /home/da2001/.ssh/sape_a.dolgiy
|
||||
IdentitiesOnly yes
|
||||
AddKeysToAgent yes
|
||||
|
||||
Host *.sapientru.net
|
||||
ForwardAgent yes
|
||||
User adolgiy
|
||||
#User root
|
||||
IdentityFile /home/da2001/.ssh/sape_a.dolgiy
|
||||
IdentitiesOnly yes
|
||||
AddKeysToAgent yes
|
||||
EOF
|
||||
```
|
||||
|
||||
или
|
||||
|
||||
```shell
|
||||
curl --create-dirs -fLo \
|
||||
~/.ssh/config \
|
||||
https://git.da2001.ru/da2001/dots/src/branch/main/config
|
||||
```
|
||||
|
||||
## Автонастройка
|
||||
|
||||
Для упрощения процесса настройки можно воспользоваться [установочным скриптом](tmux_zsh_install.sh)
|
||||
@@ -35,7 +91,7 @@ wget https://git.da2001.ru/da2001/dots/raw/branch/main/tmux_zsh_install.sh
|
||||
Скрипт необходимо запукать от имени текущего пользователя. Пользователь должен имень привилегии `sudo`, в процессе выполнения скрипт попросит ввести пароль для установки пакетов и смены консоли пользователя.
|
||||
|
||||
```shell
|
||||
bash install.sh
|
||||
bash tmux_zsh_install.sh
|
||||
```
|
||||
|
||||
## Ручная настройка
|
||||
@@ -180,4 +236,5 @@ source $HOME/.aliases
|
||||
.aliases
|
||||
alias ip='ip --color=auto'
|
||||
alias ssht='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
|
||||
alias gp="git add -A && git commit -m \"modify: $(date)\" && git push"
|
||||
```
|
||||
|
||||
30
config
Normal file
30
config
Normal file
@@ -0,0 +1,30 @@
|
||||
Host 10.1.*
|
||||
User da2001
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile /dev/null
|
||||
|
||||
Host bastion_local
|
||||
Hostname 192.168.13.10
|
||||
User da2001
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile /dev/null
|
||||
|
||||
Host docker
|
||||
Hostname 192.168.13.7
|
||||
User da2001
|
||||
|
||||
Host *.qwarta.ru
|
||||
ForwardAgent yes
|
||||
User adolgiy
|
||||
#User root
|
||||
IdentityFile /home/da2001/.ssh/sape_a.dolgiy
|
||||
IdentitiesOnly yes
|
||||
AddKeysToAgent yes
|
||||
|
||||
Host *.sapientru.net
|
||||
ForwardAgent yes
|
||||
User adolgiy
|
||||
#User root
|
||||
IdentityFile /home/da2001/.ssh/sape_a.dolgiy
|
||||
IdentitiesOnly yes
|
||||
AddKeysToAgent yes
|
||||
@@ -26,6 +26,7 @@ echo "Create => .aliases"
|
||||
cat << EOF >> ~/.aliases
|
||||
alias ip='ip --color=auto'
|
||||
alias ssht='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
|
||||
alias gp="git add -A && git commit -m \"modify: $(date)\" && git push"
|
||||
EOF
|
||||
|
||||
echo "Add link .aliases to .bashrc"
|
||||
@@ -40,6 +41,37 @@ cat << EOF >> ~/.zshrc
|
||||
source ~/.aliases
|
||||
EOF
|
||||
|
||||
# Git config
|
||||
if [ ! -f ~/.gitconfig ]; then
|
||||
echo "Add aliases to .gitconfig"
|
||||
cat << EOF >> ~/.gitconfig
|
||||
[alias]
|
||||
co = checkout
|
||||
ci = commit
|
||||
st = status
|
||||
sw = switch
|
||||
br = branch
|
||||
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
|
||||
hi = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
|
||||
type = cat-file -t
|
||||
t = cat-file -t
|
||||
dump = cat-file -p
|
||||
d = cat-file -p
|
||||
|
||||
undo = reset HEAD~1 --mixed
|
||||
u = reset HEAD~1 --mixed
|
||||
|
||||
wipe = !git reset --hard
|
||||
|
||||
send = !git push origin HEAD
|
||||
lo = log --all --oneline --graph
|
||||
l = log --all --oneline --graph
|
||||
EOF
|
||||
else
|
||||
echo "File \"~/.gitconfig\" exists, skip adding"
|
||||
fi
|
||||
|
||||
|
||||
# Shell to zsh
|
||||
echo "Change shell for $USER"
|
||||
sudo -k chsh -s "$(which zsh)" "$USER" # -k forces the password prompt
|
||||
|
||||
Reference in New Issue
Block a user