Customizing and remote desktops
So yesterday, for the first time, I actually connected a keyboard, mouse and monitor to my Pi. Until now everything was done remotely, but I thought it was time to try the HDMI to DVI plug I just got in the mail, and also to see if I could get some sound out of the Pi. So, more connections than usual were made:
And then I found out I couldn’t log in anymore: bad password. What the…? Oh wait, I know what this is: those silly British chaps, so smart to come up with something like the Pi, totally forgot to add an option to change the keyboard language in their configuration tool. Yes you can change the keyboard layout, but then it is still a British keyboard, with the characters all in the wrong place… Anyway, it is simple to remedy. I logged in remotely and edited this file:
Then find this line and change the “gb” to something else, “us” in my case:
After that, reboot. The next boot will probably take longer than usual, but don’t despair, that’s normal.
Add a new user
Raspbian comes standard with a single user, apart from the root user which by default can not log in interactively. It is very easy to add a new user with the same privileges as the standard user “pi”, that is: a sudo user. We begin by creating this new user, we’ll call him “john” (note that almost everything is case-sensitive in Linux, even user names!):
You’ll then be asked for the new user’s password twice, and some additional user information which you can either fill in or just skip, as you please.
Next step is to give this user sudo privileges, in other words we’ll give him the right to use the sudo command. There’s a command just for that:
This opens the nano editor (the default text editor in Raspbian). With your cursor scroll down until you find this line:
Below this line, add a similar line but change the “pi” part to “john”. Or, as I did, if you want to get completely rid of the user “pi”, just change “pi” to “john”. To save a file in nano, use ctrl-o. Specific to the visudo command, nano wants to save the file as /etc/sudoers.tmp. Remove the “.tmp” part and enter to save. Then use ctrl-x to close the nano editor.
Logout (yes: just type logout) and login again as the new user. Then try a sudo command to check if this user indeed has sudo privileges.
As I already said, my goal was to get completely rid of the “pi” user. It is already gone from the /etc/sudoers file, which leaves only one additional step to accomplish this:
You can omit the “-remove-home” part if you want to keep the user’s home folder intact for now, but in this case I can’t think of a reason why you should. By removing the “pi” user you just have made you Pi a little bit more secure by removing the login that just about the whole world and his wife know about!
Remote desktop with RDP
When most people talk about Linux and remote desktops, they talk about VNC. Which is all right I guess, but why the effort of installing a VNC client on your Windows PC if the build in RDP protocol (with mstsc.exe as client) works just as well? And it’s not as if installing RDP to your Pi is a huge effort:
And reboot. Is that it? Yes…that’s all! When you start a RDP session from your Windows PC, this is the login screen:
Leave the module as “sesman-Xvnc”, even if we aren’t using a VNC client, and just login. Here’s my LXDE desktop, with a tiny bit of customizing (notably the background and the taskbar). It is surprisingly “Windows-like” and after a little bit of getting used to pleasantly to work with:
That’s it for now. Next time I plan to tell a bit about the somewhat more user friendly package manager I installed in de desktop, plus some additional customization and tips.