Showing posts from July, 2011

How to recover deleted files in Ubuntu

Hello there Ubuntu users once more.

How you deleted a file by mistake that you must desperately recover ?

I had and I searched around a way to recover that file, and many more, through terminal, because let's face it. When you are in black screen your options and knowledge is limited.

My suggestion in scalpel.

sudo apt-get install scalpel

to install the package.

The configuration file is the

/etc/scalpel/scalpel.conf file

where youmust uncomment the type of files that you wish to recover. Once you have them uncommented,

sudo scalpel <partition> -o <destination dir>

sudo scalpel /dev/sda1 -o /home/user/recovered.

I recommend creating a directory, since is must be empty.

The whole process will take a while, since it goes through each block of the partition in the HDD, but it worths the time.

Good luck.

Advanced readers are encouraged to look up more here.

Manage firewall in Ubuntu 11.04

Hi the Ubuntu users.

I suggest ufw to manage the firewall. Check the status
sudo ufw status

enable it or disable it by typing
sudo ufw enable / disable 

There are two default policies for the firewall. Either block all incoming unless otherwise expressed with rules, or allow all incoming connections unless otherwise blocked by rules.
I suggest to block all incoming and to add rules to allow specific ports, protocols or services to access you. However, this can be an issue for common use. Choose your policy wise.

sudo ufw default deny (or) allow
according to your needs. I'll continue assuming I have chosen the deny one.

sudo ufw status 
will list any existing rules. Type 

sudo ufw app list 
to check the allowed services. Now type 

sudo cat /etc/service | grep ftp | cat
to list the services for eg. FTP. To add a rule for port 20 and TCP protocol in ufw type
sudo ufw allow 20/tcp

Check it by typing sudo ufw status
Finally make sure to enable the firewall logging by typing
sudo ufw logging on.

Good luck…

Share folders through Samba in Ubuntu 11.04

Hi there Ubuntu users.

This is a small and fast how to guide to enable sharing through sabma in Ubuntu 11.04.

sudo apt-get install smbfs
to install smb packages if you already ahven't. 

Then create a password for the user whose folder you wish to share. In our case it the the "shareuser" user, so that we share his home directory and throw files locally.

Create a samba password for that user
sudo smbpasswd -a shareuser

Then add some lines to the smb.conf file
sudo nano /etc/samba/smb.conf

Add those lines

    comment = shareuser Private Files
    path = /home/shareuser
    valid users = shareuser
    public = no
    writable = yes

Restart samba service and your done.
sudo restart smbd && nmbd

Make sure that your firewall is not blocking connections (check this for a firewall guide) and you are done.

Good luck

Setup FTP server in Ubuntu server 11.04 (Terminal only)

Hey there Ubuntu users. This is a small how to guide, in order to setup a FTP server in Ubuntu 11.04 Server Edition using terminal only.

First you ' ll need to download vsftpd package from repos. Make sure that your list is updated.
sudo apt-get update
sudo apt-get install vsftpd

The service that will be used for the FTP server is vsftp under /etc/init.d/vsftpd

The configuration file for vsftpd can be accessed by typing
sudo nano /etc/vsftpd.conf 

It is there where all configuration actions will take place. There many issues to be covered here. 
Inside the conf file there are examples of what to allow and what to tweak. By uncommenting or uncommenting (#) each particular line will be read or not. Give it a look. If there is something you don't understand, just leave it as it is. Maybe by the end of this guide you' ll figure out what it does. 

First by default anonymous users are not allowed. 
I suggest leaving that this way. 

In addition by default local system use…