Pico's world

RSS

Posts tagged with "linux"

Allowing SSH via private keys for new users

  1. Create a new user: sudo useradd ‘username’
  2. Set the password: sudo passwd ‘username’
  3. Login to that user: su - ‘username’
  4. Create folder ~/.ssh: mkdir ~/.ssh
  5. chmod that folder to 700: chmod 700 ~/.ssh
  6. Generate public/private key: ssh-keygen (you don’t have to put a password, but should for better protection)
  7. cat the contents of id_rsa.pub to ~/.ssh/authorized_keys
  8. To allow the user to ssh in, open the sshd_config: vim /etc/ssh/sshd_config
  9. Append AllowUsers ‘username’

I got stuck a few times because I skipped steps #5.

A pretty nifty trick when you are ssh-ing in is to add the -v when you ssh, so you can see some messages as to why you ssh is unsuccessful (many times, I had the wrong path).

ssh -i /location/of/privatekey -v username@hostaddress 

Aug 6

Adding a keyboard shortcut for System Monitor in Ubuntu

Being accustomed to Windows, I usually press Ctrl-Shift-Esc to open up the task manager when I want to see system information like memory usage and cpu usage.

I was a bit surprised that the same key combination did nothing in Ubuntu. So I created a keyboard shortcut to open the gnome system monitor.

I am doing these steps in Ubuntu 11.04

  1. Open application ‘Keyboard Shortcuts’
  2. Click on ‘Add’
  3. Enter a name, ‘System Monitor’ in my case, and the command ‘gnome-system-monitor’
  4. Click Apply
  5. Find ‘System Monitor’ and double click on the Shortcut column.
  6. Now press the key combination you want, in my case Ctrl-Shift-Esc
  7. Click close

I really like the customizing power of Ubuntu!

Aug 2

Do I need Windows anymore?

Ever since I got my hands on a free EC2 instance, I got a lot of exposure to Linux. I would ssh in to try things out, like deploying nginx and gunicorn, using vim to configure my settings, and writing code to get django up and running. I scoured the web looking to ‘pimp’ out my vim editor, found some excellent blog post such as this one from John Anderson. Trying to get his configuration from github to work on windows has proved very difficult, for one, command-t, needs to have vim compiled with ruby support. In linux you can get the source code and compile it it with ruby support, while it is possible in Windows, it’s just not something I want to do.

After seemingly getting a popup from windows asking me to update Windows Vista every other day, I got myself asking, what is stopping me from making the switch to Linux? It used to be games, but these days, when I do play, I play all my games on the PS3 or the Xbox360.

I will start the process to change my laptop’s OS from Windows to Ubuntu. I will need to backup my files, hopefully I won’t forget something!

Checking memory usage in Linux

One thing that annoyed me a little in linux when I started out was checking for free memory space remaining.

Read More