Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Removed opened port in ufw

Answer:

If you have opened a port using the ufw command in Ubuntu, but now you want to delete it, you can..

# sudo ufw delete allow 8080/tcp

And then do a reload

# # sudo ufw reload

That's all.

How to perform a reverse DNS lookup in Linux

Answer:

To perform a reverse DNS lookup for a domain in Linux, you can use the dig command, e.g.

# dig -x 8.8.8.8

; <<>> DiG 9.7.0-P1 <<>> -x 8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59808
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;8.8.8.8.in-addr.arpa.          IN      PTR

;; ANSWER SECTION:
8.8.8.8.in-addr.arpa.   86328   IN      PTR     google-public-dns-a.google.com.

..

Erase old downloaded packages from apt-get's cache

Answer:

The erase old downloaded packages from apt-get's cache, which are stored under the location: /var/cache/apt/archives

Try:

# sudo apt-get autoclean

Disable a service in Ubuntu using upstart

Answer:

In newer version of Ubuntu such as 10.04, some services are managed by upstart and you cannot disable them by using the old method.

For example, to disable the OpenSSH server, you need to edit the file /etc/init/ssh.conf, comment out the following lines:

# start on filesystem
# stop on runlevel [!2345]

Then this service will not start when you reboot your machine next time. All the upstart configurations files are under this folder and feel free to try it out.

Allow a remote IP for incoming connection in UFW (Uncomplicated firewall)

Answer:

To allow a remote IP for incoming connection in Ubuntu's UFW (Uncomplicated firewall), you can use the following command:

# sudo ufw allow from x.x.x.x

Of course you need to reload the firewall.

# sudo ufw reload