Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts

2016-06-22

adding authorized keys using ansible


You can use jinja template engine to set this

vars:
  ssh_user_key:
    - user: ritesh
      exclusive: no
      keys:
        - ritesh.centos
        - ritesh.fedora

- name: ssh user key upload
  authorized_key:
    user: "{{ item.user }}"
    exclusive: "{{ item.exclusive if item.exclusive is defined else 'no' }}"
    key: "{% for file_name in item['keys'] %} {{ key|default('') + lookup('file', file_name) }}{% if not loop.last %}{{ '\n' }}{% endif %} {% endfor %}"
  become_user: "{{ item.user }}"
  become: yes

  with_items:
    - "{{ ssh_user_key }}"
  tags:
    - setup-user-ssh-client-key



adding authorized keys using ansible


You can use jinja template engine to set this

vars:
  ssh_user_key:
    - user: ritesh
      exclusive: no
      keys:
        - ritesh.centos
        - ritesh.fedora

- name: ssh user key upload
  authorized_key:
    user: "{{ item.user }}"
    exclusive: "{{ item.exclusive if item.exclusive is defined else 'no' }}"
    key: "{% for file_name in item['keys'] %} {{ key|default('') + lookup('file', file_name) }}{% if not loop.last %}{{ '\n' }}{% endif %} {% endfor %}"
  become_user: "{{ item.user }}"
  become: yes

  with_items:
    - "{{ ssh_user_key }}"
  tags:
    - setup-user-ssh-client-key



2008-11-21

close ssh session

How does one close an ssh session, which has been disconnected from server ?
use the keycombo "~." , without quotes. For more info, do check man pages.

$ man ssh

Prologue

I was happily working on my system, trying to access my test box remotely. And then, there was darkness, or as most people would call it as power failure. Yes, I do not have a UPS as yet ( under repair ) and i ended up with a "hung" ssh session.

GitLab runner on Windows with bash shell on windows contianer on Docker

As part of your pipeline, you may need to perform browser testing across different platforms/environments. To minimize testing time, it'...