resolvconf not modifying resolv.conf

In some Linux distributions, and other Unix-like operating systems, the resolvconf program maintains the system information about the currently available name servers and manages the contents of the configuration file resolv.conf, which determines Domain Name System (DNS) resolver parameters.

When computer connects to the internet, the domain name must be convert to corresponding IP address. The Domain Name Server is responsible for this conversion by maintaining a list of domain names and corresponding IP address. The information about the servers is kept in the configuration file resolv.conf.

The resolv.conf file exist at location /etc/resolv.conf which is a symbolic link to /run/resolvconf/resolv.conf. When computer connects to internet, resolvconf gets the name-servers from DHCP and list in resolv.conf file. But sometimes this fails to happen.

One of the reason may be that you deliberately change /etc/resolv.conf file to fill name-servers manually. Now /etc/resolv.conf file is no more a symbolic link and resolvconf doesn’t update /etc/resolv.conf file. Now you find yourself in all problems related to resolv.conf.

The solution is to configure resolvconf again. Make a backup copy of resolv.conf and use the following command

sudo dpkg-reconfigure resolvconf

Answer Yes to all queries which follow.

Advertisements

Restoring default groups in Ubuntu

Sometimes it happen that user messes up with the groups of its user account while trying adding or removing some group or doing something which indirectly affect them. Ubuntu provides following command to add user to the group:
usermod -G group1,group2,... user
The default action of the command is that the user is added to the specified groups but removed from all other groups. -a parameter is needed to be given to append the group instead of replacing.
It is one of the most common lapse from user and they ended up with their sudoer account not able access many of the resources.

The solution to this is to find out the default groups and then adding them explicitly. One can ask someone who has unmodified groups the list of groups his account is added to.
groups gives the list of groups to which the current user is added.

Instead the user can also view the default groups without needing others help. There exists a log file which is created at the time of installation containing the log of processes it has gone through. The addition of user to different groups is definitely one of the process. The path of file is /var/log/installer/syslog.
Just view the log output which contain user-setup as a substring.
cat /var/log/installer/syslog | grep user-setup

The output comes as
Jun 29 22:35:54 ubuntu user-setup: pwconv: failed to change the mode of /etc/passwd- to 0600
Jun 29 22:35:54 ubuntu user-setup: Shadow passwords are now on.
Jun 29 22:35:55 ubuntu user-setup: Adding user `userabc' ...
Jun 29 22:35:55 ubuntu user-setup: Adding new group `userabc' (1000) ...
Jun 29 22:35:55 ubuntu user-setup: Adding new user `userabc' (1000) with group `userabc' ...
Jun 29 22:35:55 ubuntu user-setup: Creating home directory `/home/userabc' ...
Jun 29 22:35:55 ubuntu user-setup: Copying files from `/etc/skel' ...
Jun 29 22:35:57 ubuntu user-setup: addgroup: The group `lpadmin' already exists as a system group. Exiting.
Jun 29 22:35:57 ubuntu user-setup: Adding group `sambashare' (GID 124) ...
Jun 29 22:35:57 ubuntu user-setup: Done.
Jun 29 22:35:57 ubuntu user-setup: Adding user `userabc' to group `adm' ...
Jun 29 22:35:57 ubuntu user-setup: Adding user userabc to group adm
Jun 29 22:35:57 ubuntu user-setup: Done.
Jun 29 22:35:57 ubuntu user-setup: Adding user `userabc' to group `cdrom' ...
Jun 29 22:35:57 ubuntu user-setup: Adding user userabc to group cdrom
Jun 29 22:35:57 ubuntu user-setup: Done.
Jun 29 22:35:57 ubuntu user-setup: Adding user `userabc' to group `dip' ...
Jun 29 22:35:57 ubuntu user-setup: Adding user userabc to group dip
Jun 29 22:35:58 ubuntu user-setup: Done.
Jun 29 22:35:58 ubuntu user-setup: Adding user `userabc' to group `lpadmin' ...
Jun 29 22:35:58 ubuntu user-setup: Adding user userabc to group lpadmin
Jun 29 22:35:58 ubuntu user-setup: Done.
Jun 29 22:35:58 ubuntu user-setup: Adding user `userabc' to group `plugdev' ...
Jun 29 22:35:58 ubuntu user-setup: Adding user userabc to group plugdev
Jun 29 22:35:58 ubuntu user-setup: Done.
Jun 29 22:35:58 ubuntu user-setup: Adding user `userabc' to group `sambashare' ...
Jun 29 22:35:58 ubuntu user-setup: Adding user userabc to group sambashare
Jun 29 22:35:58 ubuntu user-setup: Done.
Jun 29 22:35:58 ubuntu user-setup: adduser: The group `debian-tor' does not exist.
Jun 29 22:35:58 ubuntu user-setup: Adding user `userabc' to group `sudo' ...
Jun 29 22:35:58 ubuntu user-setup: Adding user userabc to group sudo
Jun 29 22:35:58 ubuntu user-setup: Done.
Jun 29 22:37:45 ubuntu ubiquity: Removing user-setup ...
Jun 29 22:37:45 ubuntu ubiquity: Purging configuration files for user-setup ...

  • The lines containing ‘Adding user userabc to group xyz’ gives the groups in which user was added which are its default groups. Manually add the user to these groups and don’t forget -a parameter.
    Login to root account.
    usermod -a -G adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare userabc
  • You need to logout and again login to view the change.
  • Give command groups to view the groups. The newly added default groups should be there.

Configuring Proxy Authentication Settings in Linux

Configuring the proxy settings in a system is fairly simple task and easy interface is provided in every Operating system to do so. However, few linux distros are devoid of proxy authentication settings which should be there in every proxy settings interface. The browsers and other applications which require internet access provide their own configuration box to get the  settings from the user. But the frustration occurs when system ends up showing something like ‘Proxy Authentication error’, while using apt-get or installing application from software manager or doing some other task where system require net access..

Here are the steps to set proxy authentication in debian based distros:

  1. Edit /etc/apt/apt.conf file using superuser permissions. If not there, create new.

    sudo gedit /etc/apt/apt.conf

  2. Add or edit the content to be in following format

    Acquire::http::proxy "http://username:password@proxy_server:proxy_port/”;
    Acquire::https::proxy "https://username:password@proxy_server:proxy_port/”;
    Acquire::ftp::proxy "ftp://username:password@proxy_server:proxy_port/";
    Acquire::socks::proxy "socks://username:password@proxy_server:proxy_port/";