Wednesday, February 18, 2015

Change UserName on ubuntu

To rename a user

  1. At the start screen press Ctrl+ALT+F1.
  2. Log in using your username and password.
  3. Set a password for the "root" account.
    sudo passwd root
  4. Log out.
    exit
  5. Log in using the "root" account and the password you have previously set.
  6. Change the username and the home folder to the new name that you want.
    usermod -l -d /home/ -m
  7. Change the group name to the new name that you want.
    groupmod -n
  8. Lock the "root" account.
    passwd -l root
  9. If you were using ecryptfs (encrypted home directory). Mount your encrypted directory using ecryptfs-recover-private and edit /.ecryptfs/Private.mnt to reflect your new home directory.
  10. Log out.
    exit
  11. press Ctrl+ALT+F7.

If you get the following error

usermod: can't change /etc/password

run the following commands in the root recovery console

mount -o remount,rw /
 
Then Rerun the usermod command
 
 
 

 

Tuesday, February 3, 2015

Setting Wallpaper Using GPO

Using Group Policy we can set wallpapers of all nodes same. we can restrict users from setting unacceptable pictures and we can keep our company preferred wallpapers like company logo, motive, today's quotes, wishes, etc.

Method 1

The “Desktop Wallpaper” method in "Administrative Templates" is the most commonly used way for configuring the Wallpaper on a computer however as it seems with all things Group Policy using this setting comes with its own pro’s and con’s.

Pro’s
  • Change is Restricted for the users
  • Works on all versions of Windows
Con’s
  • Limited targeting only based on standard Group Policy Object’s (OU,Security Filter,Site,WMI & Domain)
User Configuration > Administrative Templates > Desktop > Desktop

specify the explicit local path or a UNC to the image you want displayed as the desktop wallpaper

image

Actually what it does is configuring the REG_SZ “Wallpaper” and the REG_SZ “WallpaperStyle”  registry keys under the HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System  path.

TIP #1: If you are running Windows 7/Server 2008 R2 pre-Service Pack 1 you will need to install hotfix http://support.microsoft.com/kb/977944 for this setting to work.
TIP #2: If you are configuring this setting I recommend that you use the “Fill” Wallpaper Style as this will work best with most screen resolutions (especially on Windows 7).
TIP #3: If you configure this setting you will need to wait for the user to logoff the computer before the background is updated.
Method 2

Method 1 configures the HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System REG_SZ “Wallpaper” key. Therefore you can also use the Group Policy Preference Registry Extension option to also set the same key to give you some added benefits.
Pro’s
Con’s
  • Must run Windows XP (or greater)
  • Must have the Group Policy Client Side Extensions installed.
simply create two registry keys 
User Configuration > Preferences > Windows Settings > Registry 
Now depending on the registry key that you configure for this setting you can either have this as a restricted (a.k.a. locked) setting or an unrestricted setting that allows the users to make their own changes.
Restricted: HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\Wallpaper
Unrestricted: HKCU\Control Panel\Desktop\Wallpaper
image
Restricted: HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\WallpaperStyle
Unrestricted: HKCU\Control Panel\Desktop\WallpaperStyle
image
Tip #4: If you don’t configured the “WallpaperStyle” registry key then users will still be able to choose their own Wallpaper Style.
If you chose the restricted registry keys to configured the wallpaper then ensure you also select the “Replace” action and “Remove this item when it is no longer applied” common option is selected (see below). If you don’t do this you will find that your users will not be able to change their wallpaper even after the policy is removed as the policy registry key will not be removed.
image
image
If you chose to use the unrestricted registry key values then also make sure you chose the “Apply once and do not reapply” option. If you don’t do this the users wallpaper will be reset ever time they log off their computer as the key will be set back to the original value during each policy refresh.
image

Configuring the Desktop Wallpaper Storage Location

Now that you know the many options for configuring the Desktop Wallpaper via Group Policy the next thing you should consider is where is the wallpaper being stored. As you can seen in the screen shots of the administrative template Desktop Wallpaper that they use the example of a UNC path. But…
image
TIP #5: DONT EVER USE A UNC PATH FOR A DESKTOP WALLPAPER… EVER!!
Simple put using a UNC path puts a lot of stress on network as it has to download file every time the wallpaper is loaded. It also means that if the network path cannot be contacted when the user logs on all they will get is a black background wallpaper. This is particularly obvious when someone logs on with a laptop not connected LAN.
So the obviously question is how do you make sure that file that the desktop wallpaper uses is always available and easily accessible? Use a script and copy the file to the local hard drive. Sure… but http://ihatelogonscripts.com and the issue with using a script is that it will only run when the computer starts up or when the user logs on. Generally this would not be a problem and if you are smart enough to use a copy program like robocopy or other such program it wont stress your LAN as it will only copy the file once. But on the day that you change the desktop wallpaper ever computer and/or user will try to download the new wallpaper all at once.
The Answer? Use Group Policy Preferences File Extension and copy the file down to the local computer.

Using the Group Policy Preferences File Extension

Using the File Extension to copy the file to the local hard drive means the file will be copied to the local hard drive making obviously available at all times. However the File Extensions options also has the advantage of being able to updated the file during each group policy refresh. This way the computer gets the updated wallpaper without having to logoff or reboot the computer and you avoid slamming the network in the morning when all the computers turn on.
image
TIP #6: Setup the file copy as a computer setting so that it will update the files even when there is no user logged on.
TIP #7: If you follow Tip #6 then you need to make sure that the desktop wallpaper file has got “Domain Computers” Read permissions so the local system account has access to copy the file from the network.