Categories: BSD

FreeBSD: add or remove an user to a group

Categories: BSD
Tags: , , ,
Published on: April 5, 2011

If you need to add an user to an existing group, or more than one, do:

pw usermod username -G group1,group2,group3

Remember that the user will be inserted ONLY in the groups that you have specified in the grouplist. If your user is in the wheel group and you do a -G ftp,games he’ll be removed from wheel and you’ll not be able to su- to root.

If you need to create a group:

pw groupadd groupname

If you need to see the users of a group:

pw groupshow groupname

If you need to remove an user from a group (for example, group2) you have to set a new list of groups and you’ve to know in which groups the user is currently:

id -Gn username
pw usermod username -G group1,group3

Creare un repository remoto con git, per piu’ utenti

Categories: BSD, Linux
Tags: , ,
Published on: March 12, 2011

A volte capita di dover sviluppare software con altre persone e il modo migliore per farlo e’ usare Git (e questa non e’ la sola ragione!).
Git e’ un VCS distribuito ideato da Linux Torlvads e altra gente molto cool :)
Lo scopo di questo howto e’ creare un repository remoto per permettere a sviluppatori di lavorare ad un progetto, il tutto tramite SSH con autenticazione tramite chiavi.
Funzionera’ cosi’: nel server/repository remoto ci sara’ un utente, “git”, con la sua home dove tenere i repository.
Avra’ una shell particolare, git-shell, che permette solo comandi di Git via SSH.
L’accesso verra’ effettuato tramite chiavi, ogni sviluppatore dovra’ avere la chiave privata, o dovrai creare una coppia di chiavi per ogni sviluppatore.
Sfortunatamente non ho trovato un modo per dire a Git quale chiave usare, quindi si prende quella di default, ~/.ssh/id_rsa.
Vediamo cosa fare.
(more…)

Start a collaborative project with git, in a remote repository

Categories: BSD, Linux
Tags: ,
Published on: March 12, 2011

Sometimes I need to develop software with other people and the best way to do this is use Git (and this is not the only reason!).
Git is an awesome distribuited version control system made by Linux Torvalds and other cool guys :)
The goal of this howto is to setup a remote git repository to permit developers to work on a project (or more), everything under SSH (with public-key authentication).
It will work like this: in the remote server there will be one user, “git”, with it’s own home where to store repositories and it will have the git-shell, a restricted login shell for Git-only SSH access.
Access will be provided with ssh key authentication so each developer must have the private key, or you’ll have to create different keys for each developer.
The bad part is that i haven’t found a way to tell git which key i want to use, it want the standard key, ~/.ssh/id_rsa.
Let’s see what to do.
(more…)

FreeBSD: change user’s shell

Categories: BSD
Tags: , ,
Published on: March 11, 2011

To change your shell in FreeBSD type:
chsh -s /usr/local/bin/bash
To change an user’s shell from root:
pw usermod $username -s /usr/local/bin/bash

ssh public-key authentication

Categories: BSD, Linux
Published on: March 11, 2011

I forgot it again, so…
First of all you have to create the keys:
ssh-keygen -t rsa
You can leave the password field blank.
Copy your fresh public key (.pub) in your remote server/machine, renaming it in “authorized_keys“:
scp ~/.ssh/id_rsa.pub remotemachine.it:/home/username/.ssh/authorized_keys
If your authorized_keys already exist just append the public key to the end.

«page 2 of 5»
Please support our sponsors ;)
Welcome , today is Sunday, May 20, 2012