Archive for the 'Sysadmin' Category

Quick tip: Add multiple users with multiple public SSH keys with Ansible

Wednesday, May 30th, 2018

Because it took me a while to figure out how to do it cleanly, here’s my solution for adding multiple users with multiple public SSH keys on a server, using Ansible:

in login-vars.yml

users:
- login: "user1"
  pass_hash: "$6$G1Q........"
  pubkeys: 
    - "ssh-rsa AAAAB3N.....yBd1 user1@first-key"
    - "ssh-rsa AAAAB3N.....eWDp user1@second-key"
- login: "user2"
  pass_hash: "$6$G1A........"
  pubkeys: 
    - "ssh-rsa AAAAB3N.....yCDd1 user2@first-key"
    - "ssh-rsa AAAAB3N.....eaop user2@second-key"

in roles/setup-users/main.yml

- name: configure user accounts
  user:
    name={{ item.login }} 
    append=yes
    password={{ item.pass_hash }}
  become: yes
  with_items:
    - "{{ shell_users }}"

- name: Add users public keys
  authorized_key:
    user={{ item.login }}
    key="{% for key in item.pubkeys %}{{ key ~ "\n" }}{% endfor %}"
  become: yes
  with_items:
    - "{{ shell_users }}"

HP Laserjet P3005: fuser disassembly and gear kit replacement

Friday, January 23rd, 2015

Here’s how to disassemble the fuser on an HP LaserJet P3005 printer, and replace the gear kit (which is a part that fails often, reference CB414-67923). First remove the sliding plastic part at the back of the printer, then remove these two screws :

1

Then remove the big plastic panel, bottom first so it disengages at the top.

Lift these two little tabs so you pull the part they’re attached on towards you, and remove it:

2

Remove the screw holding the next panel in place (then remove it by putting the cable at the left away, and be careful not to break the clip at the right). I don’t think this is necessary, in reality. I did it because I didn’t know where I was going.

3

Then unplug the fuser cables (the cover on the power panel comes off with no screws) :

4

5

And unscrew the four screws :

6

You can then pull the fuser away and reach the gears. From left to right, the first one has a plastic tab keeping it in place, which you can pull with a little screwdriver. The second one is free when you remove the first. The third one is freed by the fourth, which is held in place by a weird little plastic piece. The sizes of the pieces are rather close but not identical, watch out for that. More details on this part of the procedure.

7

news for few, stuff no-one cares about