Sunday, August 23, 2009

Windows Hacks, Tips and Tricks

Windows Hacks, Tips and Tricks
TAGS: windows, xp, microsoft, ie

I have some secret Windows tips and tricks here. Many are problems which you may encounter, but for which Windows does not provide a readymade solution.

Registry
Display a banner each time Windows boots
1.Start -> Run
2.Type regedit
3.Go to the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WinLogon
4.Create a new string value in the right pane named LegalNoticeCaption and enter the value that you want to see in the menubar
5.Create a new string value and name it LegalNoticeText. Modify it and insert the message you want to display each time Windows boots.
Windows
Shutting down Windows the fastest way
1.Start -> Run
2.Type rundll.exe user.exe,exitwindows
Internet Explorer
Your browser logo shows something other than the IE logo. Maybe you have installed your ISP software and you have a different logo on the top right. How do you remove it?
1.Close all browser windows
2.Start -> Run
3.Type RunDLL32.EXE IEdkcs32.dll,Clear
4.Click on OK, and start Internet Explorer. You should find the old spinning IE logo.

Tuesday, August 4, 2009

Linux user management

Every user who has access to a Linux system needs a login and a password. Each user must belong to a primary group and for security or access purposes can belong to several secondary groups.
In order to create new logins, modify or delete users, you must already be logged in as root. The root login is the highest level and only certain individuals should have access to the root account.
useradd - Adding a new user
Options:
• -d home directory
• -s starting program (shell)
• -p password
• -g (primary group assigned to the users)
• -G (Other groups the user belongs to)
• -m (Create the user's home directory
Example: To add a new user with
• a primary group of users
• a second group mgmt
• starting shell /bin/bash
• password of xxxx
• home directory of roger
• create home directory
• a login name of roger
useradd -gusers -Gmgmt -s/bin/shell -pxxxx -d/home/roger -m roger
top of page
________________________________________
usermod - Modifying existing user
Options:
• -d home directory
• -s starting program (shell)
• -p password
• -g (primary group assigned to the users)
• -G (Other groups the user belongs to)
Example: To add the group 'others' to the user roger
usermod -Gothers roger
________________________________________
userdel - Deleting a user
Options:
• -r (remove home directory)
Example: To remove the user 'roger' and his home directory
userdel -r roger
________________________________________
passwd - User's Password
Options:
• user's name (Only required if you are root and want to change another user's password)
Example: To change the password for the account you are currently logged in as...
passwd
Enter existing password
Enter new password
Enter new password again (to validate)
Example: To change the password for the user 'roger' (only you are logged in as root)...
passwd roger
Enter existing password (can be either roger's password or root's password)
Enter new password
Enter new password again (to validate)
________________________________________
Where user and group information stored
User names and primary groups are stored in /etc/passwd. This file can be directly edited using the 'vi' editor, although this is not recommended. Format of the file is...
• User (name normally all lower case)
• Password (encrypted - only contains the letter 'x')
• User ID (a unique number of each user)
• Primary Group ID
• Comment (Normally the person's full name)
• Home directory (normally /home/
• Default shell (normally /bin/bash)
Each field is separated by a colon.
Passwords for each user are stored in /etc/shadow. This file should only be changed using the passwd command.
Group information is stored in /etc/group. This file can be directly edited using the 'vi' editor. Format of the file is...
• Group name
• Group password (hardly ever used)
• Group ID
• User names (separated by commas)
Each field is separated by a colon.
Default files
When a new user is created, the default files and directories that are created are stored in /etc/skel.
This directory can be modified to fit your needs. Modifications only effect new users and does not change anything for existing users.
________________________________________
su - Switch User
To switch to another user, use the su command. This is most commonly used to switch to the root account.
Example: To switch to root account...
su
Enter root's passwd
Example: To switch to the user 'roger'...
su roger
Enter roger's or root's passwd
To return to original user, enter exit

Linux User Management
ac Print statistics about users' connect time.
accton Turn on accounting of processes. To turn it on type "accton /var/log/pacct".
adduser Ex: adduser mark - Effect: Adds a user to the system named mark
chage Used to change the time the user's password will expire.
chfn Change the user full name field finger information
chgrp Changes the group ownership of files.
chown Change the owner of file(s ) to another user.
chpasswd Update password file in batch.
chroot Run command or interactive shell with special root directory.
chsh Change the login shell.
edquota Used to edit user or group quotas. This program uses the vi editor to edit the quota.user and quota.group files. If the environment variable EDITOR is set to emacs, the emacs editor will be used. Type "export EDITOR=emacs" to set that variable.
faillog Examine faillog and set login failure limits.
finger See what users are running on a system.
gpasswd Administer the /etc/group file.
groupadd Create a new group.
grpck Verify the integrity of group files.
grpconv Creates /etc/gshadow from the file /etc/group which converts to shadow passwords.
grpunconv Uses the files /etc/passwd and /etc/shadow to create /etc/passwd, then deletes /etc/shadow which converts from shadow passwords.
groupdel Delete a group.
groupmod Modify a group.
groups Print the groups a user is in
id Print real and effective user id and group ids.
last Display the last users logged on and how long.
lastb Shows failed login attempts. This command requires the file /var/log/btmp to exist in order to work. Type "touch /var/log/btmp" to begin logging to this file.
lastcomm Display information about previous commands in reverse order. Works only if process accounting is on.
lastlog Formats and prints the contents of the last login.
logname Print user's login name.
newgrp Lets a suer log in to a new group.
newusers Update and create newusers in batch.
passwd Set a user's pass word.
pwck Verify integrity of password files.
pwconv Convert to and from shadow passwords and groups.
quota Display users' limits and current disk usage.
quotaoff Turns system quotas off.
quotaon Turns system quotas on.
quotacheck Used to check a filesystem for usage, and update the quota.user file.
repquota Lists a summary of quota information on filesystems.
sa Generates a summary of information about users' processes that are stored in the /var/log/pacct file.
smbclient Works similar to an ftp client enabling the user to transfer files to and from a windows based computer.
smbmount Allows a shared directory on a windows machine to be mounted on the Linux machine.
smbpasswd Program to change users passwords for samba.
su Ex: su mark - Effect: changes the user to mark, If not root will need marks password.
sulogin Single user login.
ulimit A bash builtin command for setting the processes a user can run.
useradd Create a new user or update default new user information.
userdel Delete a user account and related files.
usermod Modify a user account.
users Print the user names of users currently logged in.
utmpdump Used for debugging.
vigr Edit the password or group files.
vipw Edit the password or group files.
w Display users logged in and what they are doing.
wall Send a message to everybody's terminal.
who Display the users logged in.
whoami Print effective user id.