Tagged: Debian Toggle Comment Threads | Keyboard Shortcuts

  • Mads Madsen 19:06 on October 13, 2024 Permalink | Reply
    Tags: Debian, mdadm, Software RAID, Ubuntu   

    Join already setup software raid 

    When moving disks from one host to another, I wanted to join the raid already setup on the disks.

    On the new host ensure mdadm is already installed.

    $ sudo apt-get install mdadm

    Scan for the raid:

    $ sudo mdadm --detail --scan

    Check that it was found successfully.

    Persist the found raid in /etc/mdadm/mdadm.conf:

    $ sudo mdadm --detail --scan >> /etc/mdadm/mdadm.conf

    Update initramfs:

    $ sudo update-initramfs -u

    Add the raid to /etc/fstab so it’ll be mounted on boot:

    /dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0

     
  • Mads Madsen 13:30 on February 16, 2019 Permalink | Reply
    Tags: Debian, Pi zero, Raspberry PI   

    Rename default pi user 

    After installing Raspbian Lite on a Raspberry PI, the default user pi is a liability. To fix this, a possibility is to create a new user and delete the old pi user, but I like recycling, so I’ll just rename the user.

    First we need to allow root login over ssh;

    1. Add PermitRootLogin yes to /etc/ssh/sshd_config
    2. Change the password of the root user $ sudo passwd root
    3. Restart ssh $ sudo service ssh restart

    Second login to the raspberry with root and execute the following;

    1. Kill all processes started by pi
      1. $ pkill -u pi
      2. $ pkill -9 -u pi
    2. $ usermod -l new_username pi
    3. $ groupmod -n new_username pi
    4. $ usermod -d /home/new_username new_username
    5. Remove PermitRootLogin yes from /etc/ssh/sshd_config
    6. Remove the root password $ passwd -d root
    7. Restart the raspberry pi $ reboot

     
  • Mads Madsen 01:44 on June 18, 2017 Permalink | Reply
    Tags: Debian, rsyslog   

    Make rsyslog log a specific program into its own log file and stop logging into syslog 

     
  • Mads Madsen 19:53 on February 13, 2014 Permalink | Reply
    Tags: , Debian, , uid, usermod   

    Change a user’s UID 

    First login as root – Clean login – sudo will not work if you’re changing a UID on an already logged in user.

    Find the user’s old UID:

    uid=1000(user1) ….

    Change the UID:

    Update files and directories owned by the user to the new UID:

    Reboot and the UID has been changed.

     
  • Mads Madsen 22:51 on April 17, 2013 Permalink | Reply
    Tags: , Debian, , , udev   

    Fixing eth numbering 

    While moving virtual machines around, it will usually mean a change on MAC addresses on the networking interfaces, which will create new eth nodes on the machine.
    Reasons for the renaming of eth nodes on the machine, is due to the persistent mapping on Linux systems using udev.
    Fixing this is done by removing the entities in the /etc/udev/rules.d/70-persistent-net.rules and reboot the machine.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel