So you inherit a box running linux and you have no idea which flavor of linux it is. How do you find out?

If all you need the kernel version you can try
uname -a

This outputs something like this

Linux localhost.localdomain 2.4.20-31.9 #1 Tue Apr 13 18:04:23 EDT 2004 i686 i686 i386 GNU/Linux

If you need the actual distro name you can try
cat /etc/*release

In Ubuntu it shows up as

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.04
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION=”Ubuntu 9.04″

Or even
cat /etc/issue

which spits out the following on Ubuntu

Ubuntu 9.04 \n \l

You can combine all three to get the following
uname -a && cat /etc/*release && cat /etc/issue

Update:
Another one to add to the list
cat /proc/version

 

The company I work for has been a Windows only shop for a long time and has recently starting moving towards Linux. We’re growing at fast pace and sustaining our operations remaining a Windows shop will be too expensive. That’s not to say we’re completely ditching MS.

I recently put into service a new server running Ubuntu Server 8.04.1 to host our SVN and continuous build server (Hudson). I was looking for a way to authenticate the server against Active Directory and came across Likewise Open. I was surprised at the simplicity of the whole setup.

  1. sudo apt-get install likewise-open
  2. sudo domainjoin-cli join yourdomain.com yourADusername
  3. sudo update-rc.d likewise-open defaults
  4. sudo /etc/init.d/likewise-open start

Just make sure to replace yourdomain.com and yourADusername with your own domain name and active directory username. If you’re using a firewall, which you should be, make sure the required TCP/UDP ports are open.

I still need to figure out how to mount network shares automatically. I’ll keep this post updated with my findings.

 

If you ever get locked out of your Ubuntu installation as I found myself to be tonight, you can reset your password quite easily using the following steps.

  1. Power up your computer.
  2. Press ESC at the grub menu.
  3. Press e for edit.
  4. Highlight the line that begins “Ubuntu, KERNEL ………” and press e.
  5. Go to the end of this line, add rw init=/bin/bash and press enter.
  6. Press b to boot your system.
  7. Your system will boot up to a passwordless root shell.
  8. Type in passwd username where username is the username you lost the password for.
  9. Set your password.
  10. Type in reboot.

That is it! you can now log in using your new password. You can even reset your root password here but cannot login with it at the login screen.

© 2021 !NSFW Suffusion theme by Sayontan Sinha