Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Proxy for `sudo`

You can setup proxy in a terminal by export environment variables http_proxy and `https_proxy'.

export http_proxy='proxy_server:port'
export https_proxy='proxy_server:port'

However, you might find the exported environment variables are not visible to sudo. This can be resovled by simplying adding the -E (preserve environment) option to sudo.

sudo …

Add Users to a Group in Linux

There are several ways to add users to a group in Linux. The following uses the sudo group as illustration.

  1. gpasswd, usermod and adduser can all be used to add a user to a given group. However, it is suggested that you use gpasswd as it is more portable and …