Tuesday, 16 December 2008

How to Lock / UnLock (Enable / Disable) Linux User Account

Before you remove an account from a system, is a good idea lock it for one week to make sure that no one use it.

To lock, you can use the follow command:
# passwd -l username (where username is the login id).
This option is used to lock the specified account and it is available to root only. The locking is performed by rendering the encrypted password into an invalid string (by prefixing the encrypted string with an !).

After that, if someone try to loginusing this account, the system will return:
# su - username
This account is currently not available.

To Unlock the same account
Following command re-enables an account by changing the password back to its previous value i.e. to value before using -l option.
# passwd -u username
This removes the '!' in front of the encrypted password

Tuesday, 2 December 2008

Quick and Simple Samba configuration

The first step is to create a share folder on your hard drive; for instance, /disk2/data. After that, you need to edit the smb.conf file, found in /etc/samba, and make it look something like this:

# Global parameters[global]
workgroup = HOME
netbios name = SAMBA
server string = Samba Server %v
map to guest = Bad User
log file = /var/log/samba/log.%m
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
preferred master = No
local master = No
dns proxy = No
security = User

# Share[Data]
path = /disk2/data
valid users = nik
read only = No
create mask = 0777
directory mask = 0777

You can copy and paste this into your conf file or make changes to your existing one.

The workgroup name needs to be the workgroup of your Windows computers, or your domain name. The netbios name is what will appear when you access the Linux computer from Windows. I am currently running a Windows domain with this setup, so I have the preferred master and local master set to no to avoid both servers from attempting to be the master browser. This will eliminate network conflicts on your Windows computers that can cause network-related outages.

For the share details, specify the valid users, or set them up later. In that section you can allow users to create their own folder and files for all to access.

The next step is to add users by the following command:

# useradd -c “Sohail Shaikh” soh
# smbpasswd -a soh
New SMB password: secret
Reenter SMB password: secret
Added user soh

Next, run the testparm command to ensure that the conf file is valid.
If it returns no errors, restart Samba with the command /etc/rc.d/rc.samba restart

Now you’re ready to test Samba.

On a Windows computer, you can either map a drive to the Samba server or access the drive using the Start-Run command and typing \\Samba\data,
“Samba” being the server name and “data” being the shared folder.

One disclaimer: this setup serves a small network or a home network. 

Monday, 1 December 2008

The Five Kinds of Computer Backup Storage

There are five kinds of computer backup storage each with its own advantages and disadvantages you should consider. We’ll briefly describe each type of computer backup storage in this article so you can choose the best option for you. I have definitely learned the hard way, over the years, about the importance of backing up files. Many times I thought my files were safe and secure when they actually were not! I also sometimes just simply forgot to backup all the files and now have a list of the mostimportant computer files to backup.
Computer Backup Storage #1: No Backups
Even a few years ago, it would be crazy to suggest to people that they use computers without making regular backups, but today it’s a very real and very legitimate option. Thanks to the prevalence of “cloud” applications from Google and other companies, many users today store all of their files and applications entirely on the Web.
If you use hosted applications for everything, then you have nothing to worry about when your computer fails. You just need to stand up, walk to another computer, and log in to start working where you left off.
This option isn’t for everyone. Anyone who still needs an offline application or wants to keep their files private from Google still needs to store files locally and should make Easy Secure Backups using the methods described later in this article.
We expect a significant rise in the number of users who store all of their data in the cloud when Google releases its upcoming Chrome operating system for computers.
Computer Backup Storage #2: Same Disk Backups
At first, making a backup to the same disk doesn’t make any sense. If the disk fails, you lose both the original and the backup copies. Plus, making a same disk backup will run slowly—hard drives aren’t designed to quickly copy data from one part of the disk to another part of the same disk.
But a same disk backup can give you access to an important computer backup storage feature: the ability to save multiple versions of the same file. For example, you can make a new copy of your accounting Excel worksheet every time you save so that you can always restore an older version if you make a mistake. You probably also want to do this with important Word documents in case you accidentally delete a few paragraphs or pages, your Outlook email files in case you delete an important email, and many other applications.
Although a same disk can be useful, you should always remember that a disk failure will wipe out both original and backup copies, so this method is best used in combination with computer backup storage methods described later in this article.
Computer Backup Storage
Computer Backup Storage #3: External Backup Disks
External backup disks is one of the cheapest methods of computer backup storage and probably also the method that offers the best privacy for your files. Best of all, external backup disks are easy to use with Windows.
Most external disks these days use USB 2.0, although a few disks use Firewire or eSATA. In any case, all you need to do is plug in your external disk and wait for Windows to load it (also called mounting). After you disk mounts, go to the Windows Backup Wizard located in the System and Maintenance menu of the Control Panel. Set up a backup and start it right away.
You have so many choices when buying an external hard drive to use for computer backup storage.
Your first backup to an external drive will take a while, but your second and subsequent backups will go much faster because Windows transfers only the files that have changed.
After you make your backup, you need to safely remove your disk and then store it somewhere safe. It’s no use to you if the same natural disaster that destroys your computer also destroys your backup. You also need to keep the disk safe from attackers or your private files could fall into the wrong hands. For both purposes, we recommend storing your backup disk in a sturdy fire-proof safe.
Thanks to the low price of disk drives, an external backup can cost much less than any of the Internet-based computer backup storage methods mentioned later in this article.
Computer Backup Storage #4: Network Storage
At businesses and even in homes, more and more people are using Network-Attached Storage (NAS), which is simply disk drives accessible over your local network. NAS offers almost all of the benefits of external backup disks and also Internet-based backups for computer backup storage. Many devices made for small and home offices are also very easy to use.
Similar to external disks, a NAS plugs into your computer—but instead of plugging into your computer directly, in plugs into your network router. You can then create a folder on your computer that stores all the files on your NAS. You can backup files to this folder like normal and you can also share files with other people on your same local network.
Because the NAS is separate from your computer, there’s much less chance it will be destroyed by any calamity that strikes your computer. You can even store NASes in a safe place where they’re resist fire damage and thieves while still connected to the network, providing the ultimate in safety and convince.
Computer Backup Storage With RAID
Another great feature available in higher-end NASes is the ability to use a Redundant Array of Independent Disks (RAID) for extra safe backups. If you use your computer for business and worry about losing thousands of dollars of data to a disk drive crash, a NAS with RAID should be an important part of your computer backup storage plan.
RAID is also available for all full-sized PC computers using a special card called a RAID controller computer backup storage, but this method can require a lot of hassle and unskilled users can easily wipe out all their data by choosing the wrong option. With a RAID-enabled NAS, all you usually need to do put a second disk drive in your NAS, browse to a Web interface, and click a button to enable RAID computer backup storage protection.
Computer Backup Storage #5: Internet-Based Backup
The sudden popularity of Dropbox has brought increased attention to the already-established industry of Internet-based backups. Non-geeks will probably appreciate Internet-based backups the most, as very little setup is required. For example, to use Dropbox, all you need to do is install the Dropbox application, create a Dropbox account, and copy your files to a Dropbox folder. Dropbox will do all of the rest.
Dropbox and Mozy both offer free 2Gb storage and promise better security, but you’re still trusting someone else with all of your most important files.  You can get online easy secure backup that is guaranteed against data loss, however it costs an absolute fortune. Livedrive offer unlimited online storage.
The main disadvantage of Dropbox is that you trust the security of your data to Dropbox. Although Dropbox uses high-security technology, any hacker who ever figures out how to get around it will have access to the private files of millions of customers—and that’s an awfully tempting target. In contrast, if you keep your own computer backup storage, you only need to worry about direct threats against your computer.
Conclusion: You Can’t Avoid Computer Backup Storage
Whether you choose to keep your data in the cloud or store it on a high-end NAS, you should still make a clear choice about how you want to keep your computer backup storage before something goes wrong and your data is suddenly gone. If you organize your computer files neatly you will find that any kind of backup is a whole lot easier!!!
Next previous home