mount a windows hibernated drive on ubuntu 12.04

if you have a hard drive from a windows computer that was in hibernation mode, and you need to mount the drive to access files, you can delete the hibernation file. you can tell ubuntu to delete the hibernation file and mount the drive anyway, giving you access to the files. by default, ubuntu will not let you mount a drive that is currently hibernated.

install ntfs-3g if you do not already have it installed.

sudo apt-get -y install ntfs-3g

mount the drive by specifying the device id and folder where you want the mounted contents to appear.

mount -t ntfs-3g -o remove_hiberfile /dev/sdf4 /home/user1/windoze/

done. the windows hibernation file has been deleted, and you can access the contents of the drive. be aware that deleting the hibernation file obviously means that any of the information that was being used at the time the disk was put into hibernation will be lost.

Advertisement

install and configure denyhosts for ssh on ubuntu 12.04

denyhosts bans your repeated ssh brute force offenders and keeps your logfiles smaller.

install denyhosts if it is not already installed.

sudo apt-get -y install denyhosts

edit /etc/hosts.allow and add your allowed ip addresses or host names to whitelist, preventing you from locking yourself out.

sudo nano /etc/hosts.allow

add the following exceptions to the file, matching your hosts:

sshd: 12.34.45.67
sshd: 34.56.78.90

restart denyhosts to commit the changes immediately.

sudo /etc/init.d/denyhosts restart

for fine grain control concerning ban times and alerts, optionally edit /etc/denyhosts.conf and adjust to suit your level of tolerance.

sudo nano /etc/denyhosts.conf

done. denyhosts is installed and will run at boot time. most brute force ssh attempts should still be logged, but restrictions are now enforced to blacklist offenders and bots.

install and configure ufw on ubuntu 12.04

ufw (uncomplicated firewall) makes it easy to allow or deny specific ports or services.

install ufw if it is not already installed.

sudo apt-get -y install ufw

enable ufw to run at boot time. since no rules are added, this will not affect your current ssh session.

sudo ufw enable

allow traffic for http, https and ssh. you can specify service names, but for this example, we specify port numbers.

sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 443

restart ufw to apply the changes immediately.

sudo service ufw restart

verify that the rules were properly applied:

sudo ufw status verbose

the projected output should look like the following:

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing)
New profiles: skip

To                         Action      From
--                         ------      ----
22                         ALLOW IN    Anywhere
80                         ALLOW IN    Anywhere
443                        ALLOW IN    Anywhere
22                         ALLOW IN    Anywhere (v6)
80                         ALLOW IN    Anywhere (v6)
443                        ALLOW IN    Anywhere (v6)

done. firewall installed and enabled at boot time, filtering all traffic except http, https and ssh. please note that this does not filter outbound traffic in any way, it merely firewalls off all ports except those specified above.