Raspberry Pi Remote Access

Hi all, I have had a raspberry pi for a while now and I realised I could set it up as a nas, so I found a guide and I'm following it (if anyone cam help with this also that would be appreciated), but as part of the guide it suggests that you set up ssh (I think that's what it was it was just some way of using it headlessly) and their guide doesn't see to work I wonder if anyone here knows how to do this?
PS. Sorry mods if this is the wrong section, but I wasn't shure and kind of thought it would class as a mini pc.
 
MORE INFO: ok i have enabled ssh on the pi and got the ip but when i try to connect it doesnt work
SSHISUE.JPG
 
Yes I am on the same network, I have used nmap to find the ip address and am using that one, I have tried using tightvnc but when I put in the pi ip it connects to my laptop and I get an infinity effect. Which isn't very helpful :(
 
on Nmap it said the ip is 192.168.1.5, but here it says its 192.168.1.11 does that mean nmap doesnt work? also now my synaptics driver has crashed and my touchpad has gone a bit wierd
 

mishra

Rising Star
I think you are getting all mixed up mate. SSH is just a console access. It was designed to give you a remote access to linux terminal only. It is there so you can manage your raspbery Pi without having to use monitor/keyboard connected to it.
If you want to use a desktop GUI then SSH is no good to you, you will not be able to start GUI by simply typing startx in your putty client.

Your first attempt at running VNC was a better choice. You first have to create a VNC server on your linux (raspberry pi), and then connect to it using your Windows machine. Alternatively, to VNC, you may want to look at NoMachine software (www.nomachine.com), this is what I used in the past and it worked great (not sure if it will work on raspbery pi tho).

On a side note, if you plan to use Raspbery Pi as a NAS you do not need GUI (startx). You can configure everything using just console.
Set static IP address on your Raspbery Pi
Use SSH to remotely manage and configure it
Connect USB drive to RaspberyPi and make sure it auto-mounts on boot-up (google: /etc/fstab)
Install Samba and configure it (/etc/samba/smb.conf)
Create your shares and give permissions where necessary
Then map your shares in Windows
.. and that's roughly all there is to it.

If you really need to have some form of GUI management maybe look at at Webmin (http://www.webmin.com/). In the end of the day, get to know your terminal commands to configure things... it is better and quicker in the long run, even though it feel a bit overwhelming at first.
 
I was following a guide on how to set up the pi as a server, I had no idea what ssh did other than it was some form of remote access (thanks for telling me what it was). The guide tells me to install samba and gives me a list of things to do, which are basically editing the files. The thing is the nano file it tells me to edit is empty and has none of the things it tells me to change. Are you able to help me set it up?
 

mishra

Rising Star
Below is guide I wrote for myself last time I did some raspberry work. Please mind you this was for an open public share (point 8). So not password protected! If you want something more secure, read up a bit more on permission or create a user specifically for connecting to samba share. But this shoudl give you a good start.

Also I am used to a file editor called VIM (point 6). VIM is great but maybe a bit over the top to start with, so swap "vim" with "pico" or "nano" or whatever file editor you have installed. So line should read:
$ sudo nano /etc/samba/smb.conf

1. Make sure all updates in place and update what need upgrading
$ sudo apt-get update
$ sudo apt-get upgrade

2. Lets restart (skip: if no upgrades)
$ sudo init 6

3. Install samba
$ sudo apt-get install samba

4. Let’s configure our samba server. It is not a silly idea to make sure we have a backup file.
$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_bak

5. Time to create a folder which we gonna link to our samba share
$ sudo mkdir /srv/sambaShare

… then give full access rights
$ sudo chmod a+rwx /srv/sambaShare

6. Then let’s edit the samba config file...
$ sudo vim /etc/samba/smb.conf

7. Once editing the file we need to make some changes...
workgroup = anything_you_like
wins support = yes

8. Next, we need to add our share

[piShare]
comment= %h share
path=/srv/sambaShare
browseable=Yes
writeable=Yes
only guest=yes
create mask=0777
directory mask=0777
public=no

8. Save changes and restart samba
$ sudo /etc/init.d/samba restart

9. Thats it

Hope this helps.
 

mishra

Rising Star
Hmm, on your Windows computer select "Win+R" key combination, then in the "Run.." prompt type:

\\192.168.1.2
and hit enter!

... but replace the above IP with IP address of your Raspbberry Pi. You should get a window that will list shares you have just created in your Samba config.
 

mishra

Rising Star
You really need to start googling things out :)
It's hard to say. You need first check if your drive is mounted?

Type command:
$ mount

... it will list all mounted drives if your drive is not there. It means you need to mount it first.

To do that you need to check what device it got assigned. Type:
$ sudo fdisk -l

Then locate your USB drive. It may be something like that /dev/sdc1

Once you know what drive is it you can mount it.
1. Create your mount point:
$ sudo mkdir /srv/usb
2. Then mount the drive
$ sudo mount /dev/sdc1 /srv/usb
3. Check with $ mount command if it's listing fine.

If it is, then go back to yuor /etc/samba/smb.conf file and add new share pointing to that folder.

Note: The above /dev/sdc1 will most likely be different on your system, so you need to look it up with the fdisk command :)
 

mishra

Rising Star
Sure np, it doesn't hurt asking. It's just sometimes it is hard to answer when missing some details of the setup.

Did you get it to work?

Also, by default, your USB drive will not be mounted once you restart your rpi. You would have to create /etc/fstab entry in order to make sure it auto-mounts every time it gets restarted. What may (and most likely will happen) your USB drive will get a different /dev/sdX each time you re-connect it to your rpi. A neat trick to avoid that is to assign in /etc/fstab mounting the drive by it's unique ID of the drive.

You can check that ID of the drive by typing:
$ sudo blkid

It will show something along the lines of:
/dev/sdX1: UUID="cac41c55-407d-46cf-b2c3-824f18a1dbda" TYPE="ntfs"

That UUID, is the unique identifier, once you know that, your /etc/fstab entry should be something like:

# Auto Mount USB drive by UUID <- this is just comment line so you know in future what you did ^^
UUID="cac41c55-407d-46cf-b2c3-824f18a1dbda" /srv/usb ntfs defaults 0 0

* obviosuly the UUID here is just example you will have a different one.

.. and finally to test if all is working fine
$ sudo mount -a

Once this is issued your USB drive should be mounted and available in /srv/usb. To test command again, umount the drive
$ sudo umount /srv/usb

.. and check mounting again:
$ sudo mount -a

If it mounted drive fine, you can restart your rpi and all should be fine. ufff some things are so difficult to explain. It would take me 30s to explain in real life. To type it all.. ehh :) at least I hope it will help.
 
Top