Tag Archives: add user to a group

Install CUPS print server on Rasbian

Install CUPS:

sudo apt-get install cups

Add yourself to a group:

sudo usermod -aG lpadmin <username>

Edit file:

sudo nano /etc/cups/cupsd.conf

And coment out line “Listen localhost:631”

# Only listen for connections from the local machine
Listen localhost:631

Make sure your file looks like this:

# Only listen for connections from the local machine
# Listen localhost:631
Port 631

< Location / >
# Restrict access to the server...
Order allow,deny
Allow @local
< /Location >

< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
Allow @local
< /Location >

< Location /admin/conf >
AuthType Default
Require user @SYSTEM

# Restrict access to the configuration files...
Order allow,deny
Allow @local
< /Location >

Restart CUPS:

sudo /etc/init.d/cups restart

Access to your CUPS via web browser:

http://<hostname>:361/admin

or

http://<IP address>:361/admin

Setup Raspberry Pi as a torrent client using Transmission

Source: Link

First, lets make some directories. (Here are examples.)

sudo mkdir /media/usbhdd/shares
sudo mkdir /media/usbhdd/shares/downloading
sudo mkdir /media/usbhdd/shares/completed

Install Transmission daemon:

sudo apt-get install transmission-daemon

Add your user to transmission group:

sudo usermod -a -G debian-transmission <username>

Change group ownership of newly created directories:

sudo chgrp debian-transmission /media/usbhdd/shares/downloading
sudo chgrp debian-transmission /media/usbhdd/shares/completed

Change permissions:

sudo chmod 770 /media/usbhdd/shares/downloading
sudo chmod 777 /media/usbhdd/shares/completed

(Note: In a given example everyone can see and change content of directory “completed”:)

Restart transmission:

sudo service transmission-daemon reload

Configure transmission by editing the file:

sudo nano /etc/transmission-daemon/settings.json

and change next lines:

"download-dir": "/media/data/complete" >>> "download-dir": "/media/usbhdd/shares/completed"
"incomplete-dir": "/media/data/incomplete" >>> "incomplete-dir": "/media/usbhdd/shares/downloading"
"rpc-password": "{d92cd99c07856ea9a0736438d722b11afdd27170L7sjhNKR" >>> "rpc-password": "<password>"
"rpc-username": "transmission" >>> "rpc-username": "<username>"

For detailed configuration check next link.

After you change /etc/transmission-daemon/settings.json file, always restart transmission daemon:

 sudo service transmission-daemon reload

You can access Transmission Web interface using your browser:

http://<hostname>:9091

or

http://<IP address>:9091

Installing minimal / netinst Raspbian on Raspberry Pi

Consult thes links: How to build your own OS with Raspbian Net Install and github:raspbian-ua-netinst.

Features

  • completely unattended, you only need working Internet connection through the Ethernet port
  • DHCP and static ip configuration (DHCP is the default)
  • always installs the latest version of Raspbian
  • configurable default settings
  • extra configuration over HTTP possible – gives unlimited flexibility
  • installation takes about 15 minutes with fast Internet from power on to sshd running
  • fits in 512MB SD card
  • default install includes fake-hwclock to save time on shutdown
  • default install includes NTP to keep time
  • /tmp is mounted as tmpfs to improve speed
  • no clutter included, you only get the bare essential packages
  • option to install root to USB drive

Visit https://github.com/debian-pi/raspbian-ua-netinst/releases and download latest archive.

(If you use Windows or Mac, format your SD card with FAT32 (consult this link: link) and extract the .zip content to it.)

To flash your SD card on Linux:

xzcat /path/to/raspbian-ua-netinst-<latest-version-number>.img.xz > /dev/mmcblk0

* Replace /dev/mmcblk0 with the path to your SD card if it’s different.

Note: You need to configure your static IP if you don’t have DHCP on the router configured. Consult this link.

Installing

In normal circumstances, you can just power on your Pi and cross your fingers.

If you don’t have a display attached you can monitor the Ethernet card leds to guess activity. When it finally reboots after installing everything you will see them going out and on a few times when Raspbian configures it on boot.

If you do have a display, you can follow the progress and catch any possible errors in the default configuration or your own modifications.

Note: During the installation you’ll see various warning messages, like “Warning: cannot read table of mounted file systems” and “dpkg: warning: ignoring pre-dependency problem!”. Those are expected and harmless.

First boot

The system is almost completely unconfigured on first boot. Here are some tasks you most definitely want to do on first boot.

The default root password is raspbian. (The user is root and the password raspbian.)

Set new root password: (can also be set during installation using rootpw in installer-config.txt, consult this link)

passwd

Configure your default locale:

dpkg-reconfigure locales

Configure your timezone:

dpkg-reconfigure tzdata

The latest kernel and firmware packages are now automatically installed during the unattended installation process. When you need a kernel module that isn’t loaded by default, you will still have to configure that manually. When a new kernel becomes available in the archives and is installed, the system will update config.txt, so it boots up the new kernel at the next reboot.

Optional: For improved memory management performance install:

apt-get install raspi-copies-and-fills

Optional: Create a swap file with

dd if=/dev/zero of=/swap bs=1M count=512 && mkswap /swap

(example is 512MB) and enable it on boot by appending

/swap none swap sw 0 0

to /etc/fstab.

echo "/swap none swap sw 0 0" >> /etc/fstab

Tuning

Add user:

adduser <username>

Example:

 adduser johndoe

To view all groups, run:

cut -d: -f1 /etc/group

If you want to add your new user to a group:

usermod -aG <groupname> <username>

Example:

usermod -aG audio,sudo,ssh,video johndoe

To view the groups you belong to:

id <username>

Install packages

Everyone is free to install the packages you need or think you will need. Recommended are:

apt-get update && apt-get install mc unzip nano sudo git build-essential alsa-base

To enable the sound module, run after the installation of alsa-base, the next:

alsactl init