№ 9447 В разделе "Sysadmin"
от September 28th, 2018,
В подшивках: Ansible, Linux, Security
This task regexps sshd_config for specific option and sets value to yes. If option not found it will be added to the end of file.
Options you want to change:
sshd_options: PubkeyAuthentication: "yes" PasswordAuthentication: "no"
Now remove from config all options you want to change:
- name: Remove all marked options from config become: yes lineinfile: path: "{{ sshd_config_path }}" state: absent regexp: '{{ item.key }}' with_dict: "{{ sshd_options }}" when: sshd_options != None and sshd_options is defined
Nice, now add your options to sshd config:
- name: Add marked options to config become: yes lineinfile: path: "{{ sshd_config_path }}" state: present line: '{{ item.key }} {{ item.value }}' with_dict: "{{ sshd_options }}" when: sshd_options != None and sshd_options is defined
If you want replace string option:
- name: Set PubkeyAuthentication = yes become: yes lineinfile: path: /etc/ssh/sshd_config regexp: '^PubkeyAuthentication no' line: 'PubkeyAuthentication yes'
Full sample here https://git.blindage.org/21h/ansible-library/src/branch/pubkey_sshd
№ 9407 В разделе "Sysadmin"
от September 12th, 2018,
В подшивках: Linux, Security
Public ppk key to openssh and out to authorized_keys file
ssh-keygen -i -f sergey.ppk >> ~/.ssh/authorized_keys
№ 9370 В разделе "Sysadmin"
от September 7th, 2018,
В подшивках: Ansible, Linux, Security
Плейбук лежит тут https://git.blindage.org/21h/ansible-ssh-management
Конфигурируется элементарно:
access_list: admin: { keypath: "../keys/admin.pub", username: "root" } techguy: { keypath: "../keys/techguy.pub", username: "root" } interserver: { keypath: "../keys/interserver.pub", username: "root" } secret_list: interserver: { keypath: "../keys/interserver.pem", username: "root" }
secret_list
отвечает за раздачу секретных ключей, они закачиваются в директорию .ssh указанного пользователя и на них выставляются соответствующие права. access_list
занимается установкой публичных ключей указанному пользователю. Ну и есть супер ключ, который устанавливается на все сервера чтобы Ansible мог заходить и раздавать права, хотя вы можете и переделать под прошлый парольный век. Внимание! Сгенерируйте ваш собственный superkey! Не нужно пользоваться тем, что я сгенерировал и оставил здесь для демонстрации концепции!
№ 9363 В разделах: Programming
Sysadmin
от September 4th, 2018,
В подшивках: Git, GPG, Security
Yes, you can sign your commits! GIT supports it out of the box.
Sample signed commit git.blindage.org/commit/e1a24a6814082efb74cbad924c68a40b505f4e74
At first, create your secret and public keys, I wrote earlier about it (for english speaking users).
Check your keys gpg --list-keys
Add your fingerprint to your git configuration
$ git config --global user.signingkey A37721C3
Now you can sign your commits!
$ git commit -a -S -m 'fixed bugs, added new'
Here you can read full git documentation about this great feature. Auto-signing of all your commits https://gist.github.com/mort3za/ad545d47dd2b54970c102fe39912f305.
№ 8758 В разделе "Sysadmin"
от April 13th, 2018,
В подшивках: Privacy, Security, Telegram, Tor
Если у вас Linux, то вы сами способны решить любую проблему с обходом блокировок. Способ ниже для виндузятников. А еще ниже для владельцев Android.
SHA1 для проверки
af3076082ac72878a0383199ca0fa288d961bae3 *tor-win32-0.3.2.10.exe
Fortune cookie: Today's spam: Watch Britney moan and cry in pleasure and ecstasy. ${SiteURL} Molly loves it huge