Access from PC

From Rsewiki
(Difference between revisions)
Jump to: navigation, search
(Using Samba)
(DNSMASQ)
 
(24 intermediate revisions by one user not shown)
Line 7: Line 7:
 
From another (Linux) PC, mount the raspberry filesystem
 
From another (Linux) PC, mount the raspberry filesystem
  
mkdir rpi  (where the filesystem will be mounted)
+
mkdir rpi  (where the filesystem will be mounted)
sshfs local@10.59.8.141: rpi    (replace IP number with inet address from above, or use sshfs local@hostnale.local: rpi)
+
sshfs local@10.59.8.141: rpi    (replace IP number or use 'sshfs local@hostname.local: rpi')
  
 
Then in directory rpi the user files on the raspberry can be manipulated.
 
Then in directory rpi the user files on the raspberry can be manipulated.
 +
 +
Before you reboot the Raspberry you should unmount:
 +
umount rpi
  
 
for other access, use (with IP address as found above, or IP replaced with hostname.local)
 
for other access, use (with IP address as found above, or IP replaced with hostname.local)
  
ssh -X local@10.59.8.141
+
ssh -X local@10.59.8.141
  
 
== Using Samba ==
 
== Using Samba ==
Line 24: Line 27:
 
install Samba
 
install Samba
 
  sudo apt install samba
 
  sudo apt install samba
 +
say YES to WINS access (if asked)
  
 
Edit configuration
 
Edit configuration
Line 31: Line 35:
 
Find your workgroup in "properties" for "my PC"  
 
Find your workgroup in "properties" for "my PC"  
  
Change here:
+
Change in [global] group:
 
  [global]
 
  [global]
 
  ## Browsing/Identification ###
 
  ## Browsing/Identification ###
Line 38: Line 42:
 
   wins support = yes
 
   wins support = yes
  
At the end of the share directory
+
At the end of the 'Share Definitions'
  
[robobot]
+
[robobot]
         comment = Pi Shared Folder
+
         comment = Pi Shared home Folder for user local
 
         path = /home/local
 
         path = /home/local
 
         browsable = yes
 
         browsable = yes
Line 48: Line 52:
  
 
This adds the share with no security - which is much the easiest way
 
This adds the share with no security - which is much the easiest way
 +
But it requires that all files need to be writeable by all!
  
 
Then allow the home directory to be modified from the share (a+w is "all allowed to write")
 
Then allow the home directory to be modified from the share (a+w is "all allowed to write")
  sudo chmod a+w /home/local
+
  sudo chmod a+w -R /home/local   # all files recursively (-R)
  
Reboot to take effect
+
New files created will not give write access until the command above is executed again!
 +
 
 +
Reboot to activate the share
 
  sudo reboot
 
  sudo reboot
  
 
Once it is back online, then from your windows (or Linux and maybe Apple) go to the file browser and networks,
 
Once it is back online, then from your windows (or Linux and maybe Apple) go to the file browser and networks,
 
after an update the Raspberry should appear, and all the files in the home directory of user "local" should be visible and editable.
 
after an update the Raspberry should appear, and all the files in the home directory of user "local" should be visible and editable.
 +
 +
Something like
 +
 +
[[File:putty-samba-share.png | 500px]]
 +
[[File:putty_samba-share.png | 600px]]
 +
 +
Samba share from Windows to the left and from Linux (Dolphin) to the right.
 +
 +
== Cable connect to laptop ==
 +
 +
NB! on most modern computers DNSMASQ is not needed, as IP will default to a range that can communicate (either IP4 or IP6)
 +
 +
Test before installing DNSMASQ
 +
 +
Connect with cable, wait a bit for them to negotiate (ca. 20 seconds at most)
 +
 +
try ping
 +
ping zephyr.local
 +
 +
where 'zephyr' is the hostname in this case.
 +
There should be a reply within approx 1ms

Latest revision as of 10:01, 24 December 2021

Back to Robobot

[edit] From a linux PC

Get filesystem on normal Linux PC

From another (Linux) PC, mount the raspberry filesystem

mkdir rpi  (where the filesystem will be mounted)
sshfs local@10.59.8.141: rpi    (replace IP number or use 'sshfs local@hostname.local: rpi')

Then in directory rpi the user files on the raspberry can be manipulated.

Before you reboot the Raspberry you should unmount:

umount rpi

for other access, use (with IP address as found above, or IP replaced with hostname.local)

ssh -X local@10.59.8.141

[edit] Using Samba

This allows a Windows PC to see the Raspberry files as a network drive

On the Raspberry with internet access

install Samba

sudo apt install samba
say YES to WINS access (if asked)

Edit configuration

 sudo nano /etc/samba/smb.conf

Change workgroup to the workgroup of your windows Find your workgroup in "properties" for "my PC"

Change in [global] group:

[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
  workgroup = workgroup
  wins support = yes

At the end of the 'Share Definitions'

[robobot]
       comment = Pi Shared home Folder for user local
       path = /home/local
       browsable = yes
       guest ok = yes
       writable = yes

This adds the share with no security - which is much the easiest way But it requires that all files need to be writeable by all!

Then allow the home directory to be modified from the share (a+w is "all allowed to write")

sudo chmod a+w -R /home/local   # all files recursively (-R)

New files created will not give write access until the command above is executed again!

Reboot to activate the share

sudo reboot

Once it is back online, then from your windows (or Linux and maybe Apple) go to the file browser and networks, after an update the Raspberry should appear, and all the files in the home directory of user "local" should be visible and editable.

Something like

Putty-samba-share.png Putty samba-share.png

Samba share from Windows to the left and from Linux (Dolphin) to the right.

[edit] Cable connect to laptop

NB! on most modern computers DNSMASQ is not needed, as IP will default to a range that can communicate (either IP4 or IP6)

Test before installing DNSMASQ

Connect with cable, wait a bit for them to negotiate (ca. 20 seconds at most)

try ping

ping zephyr.local

where 'zephyr' is the hostname in this case. There should be a reply within approx 1ms

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox