Monday, June 6, 2011

Ubuntu tips & tricks : Braindump

SSH disconnecting frequently
       1.) Add the below lines to /etc/ssh/sshd_config -
                      ClientAliveInterval 600
                      ClientAliveCountMax 3

       2.) Now restart the ssh deamon on ubuntu
                     sudo /etc/init.d/ssh restart

Install dig on Ubuntu
apt-get install dnsutils

How to find the version of ubuntu
cat /etc/lsb-release : This will give you the exact version, e.g. 9.10 & the name of the release. Btw, lsb means "Linux standard base"
32bit or 64 bits : uname -m
32bit or 64 bits : getconf LONG_BIT
I bet there are lot of other ways, but this works on the most basic stripped down ubuntu

Add user : sudo useradd -d /home/testuser -m testuser
     Here "testuser" is the name of the user being created.
Create a new group : groupadd mygroup
     Here "mygroup" is the name of group being created
     You can see the group by : less /etc/group
Add existing user to a groupuseradd -a -G mygroup testuser
     You can see what groups the user is in, by doing a "id testuser"