Friday, 24 January 2014

Ubuntu to Windows Domain via Active Directory

|0 comments
Attach Ubuntu to Windows Domain via Active Directory (+ sudo)
Posted by Jagdish Goswami
There may not be too many advantages to adding your Ubuntu machines to your Windows domain, but if you think of them this will allow you to work toward them.  It’s actually pretty easy to add a Linux box to Active Directory.  This is true because AD started out life as an LDAP server and it still retains its LDAP genes somewhere deep inside its withered exterior.
First thing you will want to do is add this utility to your Ubuntu machine:
sudo apt-get install likewise-open
It will allow you to authenticate against AD using Kerberos.  If you don’t know what that means it’s not important at this stage; it’s enough to understand that it’s a secure method for assuring identity between your client machine and your AD server.
I then added the machine to the domain.  Again this is a simple operation.  Before you do anything on the Ubuntu machine, hop into Active Directory and create a machine account in the name of the Ubuntu machine.  Then back on the Ubuntu machine it’s one line of code:
sudo domainjoin-cli join [domain.name] [username]
Easy enough.
Further I added a domain group to the local sudo group by adding these lines to the/etc/sudoers file:
# Active Directory group [groupname] given sudo privs
%[domain.name]\\[groupname] ALL=(ALL) ALL
If you don’t know how to edit a protected file like /etc/sudoers I recommend using Gedit:
gksudo gedit /etc/sudoers
Just add those two lines to the end of the file.  The first line is just a comment line and could say something different.  Replace those items in the square brackets with the appropriate information to your network.
For the group I created in Active Directory to grant these sudo privileges I included Domain Administrators and a couple of individuals who would likely be using the Ubuntu box and need sudo rights.  If you’d rather you could substitute a username for thegroupname in the edit above, but I think it’s better to use a security group in AD since you’re now attached to it.
Anyway, that’s about it.  Not too exciting but sure it’s useful for something.  Have fun with it.

(The same can be done with Macs or probably any Unix-like system as long as it can authenticate against an LDAP.  Of course for other systems the details will be, you know, different.)

Wednesday, 8 January 2014

CCNP Basics | IT HELP (CCNA,CCNP,MCSE,LINUX,VMWARE,CLOUD MGN)

|0 comments

Thursday, 18 July 2013

How to launch VMware Player VMs without GUI

|0 comments

How to launch VMware Player VMs without GUI

 

I assume that you have already created a VM using VMware Player, and so have *.vmx files ready somewhere. Now you want to start/stop the VM using vmrun. You don’t need root permission to use vmrun command.
First, download VMware VIX for Linux, and then install it on the VMware host as follows.
$ chmod 755 ./VMware-VIX-1.11.0-471780.x86_64
$ sudo ./VMware-VIX-1.11.0-471780.x86_64
To start VM:
$ vmrun -T player start /path/to/vm/my.vmx nogui
To reboot VM:
$ vmrun -T player reset /path/to/vm/my.vmx soft
To power off VM:
$ vmrun -T player stop /path/to/vm/my.vmx soft
VMware Player does not support VM snapshot operations. So you cannot take a snapshot of VMware Player VMs using vmrun. But if your VM was created using VMware Workstation or VMware Fusion, you can take a snapshot of a running VM as follows.
$ vmrun -T ws (or fusion) snapshot /path/to/vm/my.vmx my_snapshot

 

 

Wednesday, 3 July 2013

How do I backup MySQL in Linux?

|0 comments
How do I backup MySQL in Linux?



1. Copying from the mysql directory
By default, MySQL databases on servers that use Linux are stored in the following directory:
/var/lib/mysql/
If you shut down the mysqld service first, you can copy your databases to an example /backup directory using the following command:
cp –Rp /var/lib/mysql/*.* /backup

The –R switch for the cp command means recursive, which you want to use because each database is in a separate directory. The –p switch is for permissions, which will maintain the permissions of what is copied.
You generally want to shutdown the mysqld service before using the above method because if a database is copied while it is actively being used, the resulting backup will be corrupt and therefore worthless. If you are certain none of the databases are not being used at the time, you can use the above command.

2. The mysqldump command
The mysqldump command lets you back up both individual databases and all databases on a server without having to shutdown the mysqld service. Because of this ability to make backups while still keeping databases online, this method is preferred.

Individual databases
An example command that would let you back up a database named example to the directory /backup while logged in as root is as follows:
mysqldump example > /backup/example_backup.sql

Unless it is a small database, it is recommended that you then compress the resulting database backup in order to reduce the amount of time necessary to transfer the backup. The following command would compress the backup of the example database:
tar czvf /backup/example_backup.tar.gz /backup./example_backup.sql

All database
If you have numerous databases and backing all of them up individually would be too time consuming, the following command will backup all MySQL databases on your server to the /backup directory:
mysqldump -A > /backup/databases.sql(or --all-databases)
The –A switch (“-all-databases” performs the same function) will dump any and all databases on the server.

How to Reset CentOS root Password

|0 comments


How to Reset CentOS root Password

For those who are forgot their CentOS root password, please do not panic. There was the easy way to reset the root password for CentOS. Please follow this steps and you will be able to access your CentOS.
1. Reboot the CentOS machine
2. When booting up, press any key to go into the select menu.
3. The press ‘e’ to navigate to second grub.conf line (kernel)
4. Once again press ‘e’ to edit the line and you can select one step from these option :
  • option 1 : 1 (’1′) at the end of the line. OR
  • option 2: S (‘S’) a the end of the line OR
  • option 3: add ‘single’ to “ro root=LABEL=/ single”
5. After edit, hit “ENTER
6. Press ‘b’ to reboot
7. After reboot it will stop at ‘#’ command line.
8. At ‘#’ command line, type ‘passwd’ to create new password.
9. Reboot machine as usual
10 Finish