Step 5: SSH Login

Once your Raspberry Pi has halted, you can disconnect it from the monitor as it is no longer needed.

Plug your Raspberry Pi's power connection in, as well as the network cable into your switch, or hub / router.
Wait a minute or so, then run your SSH client. (I used PuTTY).

Type your hostname into the hostname box, and use port 22. (The hostname is the one you set earlier).
Then click "Open".

As this is the first time you have connected to your Raspberry Pi via SSH, you will get a security warning. Click "Yes" to continue.

Now you can login to your Raspberry Pi with the username: pi and password: raspberry.

Since SSH is working, you no longer need to worry about plugging in a monitor, or keyboard, so you Raspberry Pi can be placed anywhere where there are power and network connections available.
Just wanted to share my experience with this Instructable. Everything went smoothly until it was time to connect to MySQL from a remote machine on the same network. So here's how to fix that: <br> <br>1. Grant access to your remote machine using: GRANT ALL ON *.* TO 'root'@'192.168.1.%' IDENTIFIED BY 'your_password_here'; (I used 192.168.1.% so that any computer on my network can connect to it) <br>2. Go into the my.cnf file (sudo nano /etc/mysql/my.cnf) file and look for &quot;bind-address&quot; and comment this out (put a # in front of the line) <br>3. Reload MySQL config (service mysql reload) <br>4. Restart MySQL server (service mysql restart) <br> <br>Hope this helps, and thank you for the great Instructable :)
<p>is the &quot;GRANT ALL ON *.* TO 'root'@'192.168.1.%' IDENTIFIED BY 'your_password_here';&quot;<br>a command you type into the terminal? or does it go into some config file?<br>btw, I can advise anybody using a remote linux server (like the Raspberry) to install 'webmin' as well</p>
<p>You get an SQL type console when you type &quot;mysql -p -u root&quot; which accepts SQL code like the GRANT. the rest is all normal console code :) btw, what a coincidence to see you here as well!</p>
<p>thanks. :-) small world :-)</p><p>well all went great with the server and it still works, just somehow the terminal program doesnt accept my login anymore :-) I know th epassword is right as I still can get in through 'Webmin'</p>
Hi there,<br>Thanks for posting this to help others :)<br>Daniel
<p>when i type sudo nano /etc/apache2/sites-enabled/000-default <br>i wont get data which is prewritten , i got an empty editor file. </p>
<p>I&acute;ve done it precis some it was described. But now I don&acute;t have no chance to come in. :(</p>
<p>This guide need some serious overlooks. WARNING IT WILL RUIN YOUR SSH-setup. Many, if not all experience the same thing. Dumb-blue-eyed as I were I followed it through since it looked thorough enough. Anyone know a get around? -.- Or will I need to get to my raspi physically now and reconfigure it? Gosh why did I not question internet.</p>
<p>Totaly, this tutorial is really bad. I have to reset everything...</p>
<p>What OS was this using? Raspbian?</p>
<p>Thank you for taking the time to create this document. It has been very helpful.</p><p>In section #9 the letter i is missing from &quot;service&quot; on this line:</p><p>Now restart the FTP server with &quot;<strong>sudo servce vsftpd restart</strong>&quot;</p><p>This should be </p><p>Now restart the FTP server with &quot;<strong>sudo serivce vsftpd restart</strong>&quot;</p>
<p>can you use this server rechable external network, and register .com to that?</p><p>please let me know, thanks!</p>
<p>Yes. Take a look at this: http://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/</p>
<p>can we use this for surfing on internet</p>
Good work, thanks
<p>Hello</p><p>I'm just trying to install mysql on my raspberry pi B+ with no success.</p><p>When I try to install: sudo apt-get install mysql-server</p><p>I've got always a message that mysql failed to start.</p><p>I looked around the internet and tryed several &quot;solutions&quot; but nothing worked.</p><p>I've installed last raspbian version on my SD.</p><p>Can you or anyone help me. Thank very much in advance.</p><p>Jos&eacute; Mar&iacute;a S&aacute;nchez</p><p>Ibiza - Spain</p>
where can i find a version of debian, the link provided does not work?
<p>You should be able to grab the Raspian image from the Raspberry Pi main website, and make the changes listed here. Though, in this instructable, he suggests a 2GB CF card, I highly recommend an 8GB or higher, as the latest images seem to be larger once they expand. Jump to http://www.raspberrypi.org/downloads/ for the images.</p>
<p>I don't know why i have this problem. After I add a &quot;#&quot; in &quot;/etc/passwd&quot;. I followed your steps and enter the command: &quot;usermod -d /var/www pi&quot;. But it said &quot;user 'pi' does not exist. Can anyone help me??</p>
<p>For some weird reason, I found that the line he wants you put a # in front of, doesn't actually exist.</p><p>If you're like me, you probably put the hashtag in front of the wrong line.</p><p><strong>#pi:x;1000:1000:,,,:home/pi:/bin/bash</strong></p><p>This line is weirdly not the same line as the one in the tutorial, though it does resemble it.</p><p>The line in the tutorial is this:</p><p><strong>pi:x;1000:1000:Raspberry Pi User,,,:home/pi:/bin/bash</strong></p><p>What I did, is I actually made a new line and wrote in the line we were supposed to hashtag, then I un-hashtagged the line that was already there when I opened the file.</p><p>It looked like this in the end:</p><p><strong>pi:x;1000:1000:,,,:home/pi:/bin/bash (Pre-existing line)</strong></p><p><strong>#pi:x;1000:1000:Raspberry Pi User,,,:home/pi:/bin/bash (Line I wrote in)</strong></p><p><strong><br></strong></p><p>It seemed to fix the issue.</p>
<p>It doesn't make scenes because the &quot;#&quot; sign is for disabling the following line without deleting it. If you just put a new line:</p><p><strong>pi:x;1000:1000:,,,:home/pi:/bin/bash (Pre-existing line)</strong></p><p><strong>#pi:x;1000:1000:Raspberry Pi User,,,:home/pi:/bin/bash (Line YOU wrote in)</strong></p><p>The # sign doesn't do anything for you. (It didn't disable the pre-existing line)</p><p>I thought this tutorial is outdated so the code is not suitable for Raspberry Pi B+. I just skipped that command and go straight. And it goes right!</p>
<p>In addition, I found a app called &quot;WebIOPi&quot;. It is more convenient to use GPIO in the web and over the web.</p>
<p>can I ask. i have basic php site. and i want to have password . so only me have acess to site. I am turning lights over internet and right now enybody can do this. can you tell me how can i protect site . I am beginer so.... </p>
<p>Tried several suggestions, aidenv5's recommendation solved the problem. Thanks aidenv5. Here is his recommendation.</p><br><p>To log in again using the user pi you need to add that user to the group pi.</p><p>ssh to pi with user root</p><p>type sudo useradd -g pi pi</p><p>type passwd pi</p><p>type new UNIX password/confirm</p><p>type exit</p><p>type exit </p>
<p>If you are having issues with running php, just run sudo chmod -R 755 /var/www/</p><p>It fixes an issue where php would not run.</p>
<p>Thanks for this, just what I needed.</p>
<p>Yes it works, works perfectly... Was getting few errors in the middle but than i realized i missed few steps.</p><p>Anyone interested in adding <a href="http://tech-diggers.com/add-reset-switch-raspberry-pi/" rel="nofollow">reset switch to Raspberry Pi</a></p>
<p>Someone needs to update this instructable. So many people are complaining about the # and other minor settings. Please update with corrections. </p>
<p>I followed this tutorial. By the end of it I could no longer log into my RPi using remote desktop! It didn't recognize my root account or pi account. When I tried to use the browser I did get the &quot;It works!&quot; page from apache, but when I tried accessing the /phpmyadmin I got banned for inserting the wrong password. I did enter the right password I created when I was setting it up. I tried restarting the RPi but had the same problems again. Please help! </p>
<p>I don't think this insctructable is very detailed nor accurate at times. A lot the steps are just given with out any justification especially as the steps proceed toward the end, which can leave you in some tight spots. Commenting out my pi user made me panic before I knew to relogin as root. At times it can be confusing and not clear exactly how to reach a particular checkpoint of a step. For instance change host name should mention the difference between eth0 and wlan0. Also accessing your apache server has to do with you IP and not the entered in hostname. There are also better ways to do things in my opinion such as phpmyadmin 'sudo apt-get install phpmyadmin.' I just think for someone getting into web development this tutorial is nice in that it lays out on the software you need to host your own server but there are simpler better ways that won't leave you guessing why the %$^# you just did that. </p>
<p>HI,</p><div>everything went well, but when i try to connect the ip on my browser not work.<br>anyone can help me?<br>thanks<br></div>
<p>Clear and concise. Great instructable!</p>
<p><strong>mv boot_enable_ssh.rc boot.rc</strong></p><p>this command is not working showing no such files or directory </p><p>help me out plzz ASAP..</p>
<p>I had to use &quot;sudo /etc/init.d/ssh start&quot; instead and it worked fine</p>
<p>after all this steps when I open putty and enter host name and press open </p><p>it shows &quot;connection refused&quot; </p><p>can any one help me out ?//</p>
<p>Im trying to login to putty and it says connection refused...</p>
<p>How to gain access to root again</p><p>do NOT remove the # in front of the pi password</p><p>login as pi</p><p>type sudo -i (gives root w/o passwd)</p><p>type passwd</p><p>enter in a NEW ROOT PASSWORD</p><p>verify password</p><p>exit</p>
<p>Good writeup.<br>I did much the same, but used lighttpd as the server. Also couple of recommendations:</p><p>If my host machine is running Linux, not Windows, try PACmanager as an alternative to putty. Bit more friendly.<br>At some point, do a &quot;sudo rpi-update&quot; to make sure your firmware's up.to.date. gets extra goodies to the camera, etc. Needs a reboot afterwards.<br>Load Filezilla on the host machine! Saves a lot of messing about!<br>If you want to put the machine on the web, checkout dnsdynamic.com. (I might write an 'instructable' for this, it's fairly easy, but...<br>Anyway, oululife.dnsdynamic.com has been running this, only interrupted when we had to decorate, for over a year without any downtime.<br>HTH<br>Andy</p>
<p>New to using the Pi. When I enter the command &quot;ifdown eth0&quot; I receive an error saying interface eth0 no configured.</p><p>Is this also causing me to get the Network Error:Connection refused?</p>
<p>Hello there,</p><p>eth0 connection is a connection via Ethernet cable, if you are using a WiFi dongle, type in wlan0 instead.</p><p>I recommend typing in &quot;sudo ifdown wlan0 &amp;&amp; sudo ifup wlan0&quot; instead as it put both command together so you can reconnect if your doing the commands remotely.</p>
<p>New to using the Pi. When I enter the command &quot;ifdown eth0&quot; I receive an error saying interface eth0 no configured.</p><p>Is this also causing me to get the Network Error:Connection refused?</p>
<p>I was able to log in as root after restarting the raspberry. Then I removed the # added for user pi. After that user pi was found again.</p>
<p>Typo after closing nano: &quot;service&quot; instead of &quot;servce&quot;</p>
<p>For installing PHPMyAdmin you should follow this tutorial, much easier and it WORKS. Great tutorial though. <a href="http://www.raspipress.com/2012/09/tutorial-install-phpmyadmin-on-your-raspberry-pi/" rel="nofollow">http://www.raspipress.com/2012/09/tutorial-install...</a> </p>
<p>You can use your Banana Pi also as a Webserver / FTP Server: </p><p>http://www.bananapi-kaufen.de/ftp-server-installieren/</p>
I followed the steps, all works fine, but now I cannot log in any more. After restart the pi user login does not work and the new password does not work either. I also tried the root user with both passwords the old and the new, nothing works. <br> <br>No I cannot log in my pi any more :( I cannot change the password file either because my mac does not mount the linux partition... <br> <br>how can login again?
<p>remove the # infront of <strong>pi:x;1000:1000:Raspberry Pi User,,,:home/pi:/bin/bash</strong></p>
<p>Ok but how to remove ? Because while adding I was connected with SSH. now can't connect with SSH so ... ?</p>
<p>login in to ssh as root</p>
<p>Hey! Same thing happened to me. What did you end up doing??? I'm so stressed! Thank you!<br></p>

About This Instructable




Bio: Hi there, I'm an engineering apprentice with a passion for computing.
More by drcurzon:
Add instructable to: