43

I've never used linux before, so this may be a problem with that, but I'm trying to simply SSH into my friends webserver using the info he gave me. I looked up that the linux command to ssh is ssh username@hostname. I'm not trying to type that into LXTerminal but everytime I hold shift and hit the number two I don't get @ I get ". Any ideas?

EGHDK
  • 1,351
  • 3
  • 13
  • 14

4 Answers4

50

You need to remap your keyboard. By default it is set to a UK map.

at the command line type:

sudo nano /etc/default/keyboard 

and hit enter. locate the following line

XKBLAYOUT=”gb”

Change the gb to us (This assumes you want a us mapping, if not replace the gb with the two letter code for your country)

and reboot your machine.

if it pauses for a long time during the keyboard mapping stage, enter the following at the command line:

sudo setupcon

Your next reboot should be much faster.

Reference:

http://elinux.org/index.php?title=R-Pi_Troubleshooting&oldid=147362#Re-mapping_the_keyboard_with_Debian_Squeeze

Steve Robillard
  • 34,988
  • 18
  • 106
  • 110
23

Steve's answer, though correct at the time, is now somewhat out of date. In Raspbian:

sudo raspi-config

and go to the configure_keyboard section with 4 Internationalisation Options -> I3 Change Keyboard Layout

You can choose the correct keyboard type and layout from there.

Ross Rogers
  • 609
  • 3
  • 7
  • 19
scruss
  • 9,117
  • 1
  • 25
  • 36
0

Raspberry Pi configuration has changed as of Jessie (2017):

  1. raspi-config no longer offers Internationalisation Options. The Localisation Options has no submenu for Change Keyboard Layout
  2. Simply setting XKBLAYOUT="us" may default to the Spanish layout.

This worked for me:

sudo nano /etc/default/keyboard

And these were my settings (I'm Canadian):

XKBMODEL="pc104"
XKBLAYOUT="ca"
XKBVARIANT="eng"

For our southern neighbors:

XKBMODEL="pc104"
XKBLAYOUT="us"
XKBVARIANT=""

There is, however, a bug with that. When you check in

Pi > Preferences > Raspberry Pi Configuration
Pi > Preferences > Keyboard and Mouse. 

it will show United States > Spanish (Latin American). I don't think it affects functionality.


To find out the layout you want, run this in the Terminal:

rc_gui

Then click on Localisation > Set Keyboard... and make your change. Click OK to close the Keyboard Layout dialog. Click Set Keyboard... once more. This time, the terminal window you will show:

Sections: ['Global']
Layouts: ['ca']
Variants: ['eng']
Options: []

Now you can put those into your

sudo nano /etc/default/keyboard

Layouts --> XKBLAYOUT
Variants --> XKBVARIANT
Colin
  • 281
  • 2
  • 6
0

Another option that doesn't use the Terminal is going into (from the GUI), Menu > Preferences > Raspberry Pi Configuration > Localization > Set Keyboard, and set it according to where you live.