This short article is an answer to the question: “How to write code on PC, and execute in on Raspberry ?”.

It’s useful especially, when you have your Raspberry Pi connected only to the network, without screen nor monitor. Then the goal is to:

  • Write code on PC.
  • Save code in pi’s home folder (/home/pi).
  • Execute code on Raspberry (SSH).

My big shortcut is based on:



sudo apt-get install samba samba-common-bin


Find file:


Set configuration lines to:

security = user
read only = no

Restart daemon:

sudo /etc/init.d/samba restart

Allow your pi user to connect Samba service:

sudo smbpasswd -a pi

You will be prompted for a password.

Usage – Windows

Windows handles samba shares without any additional software. This can be done in 3 steps:

  • Map network drive (remember that this could be done for any other user):
  • Type in your and username and password.
  • Enjoy ! :)

After all you have access to your Raspberry user’s home directory. You can create project on PC and configure your IDE to use it:)

Edit1: Windows – troubleshooting

Windows saves credentials of your connection after first successful login. You can show this setting by executing the following command:

 net use

Example result:

net useThis means that Windows stores credentials to three hosts:

  • on acount pi
  • on account pi
  • on account amigo

This could couse problems, when you change password to your Samba share:

 Login Failure: Unknown user name or bad password.

You have to reset Windows credentials storage by executing command similiar to this example:

net use \\\pi /delete

Next login try will be successful :)

Edit2: Samba – hints

You can also create share to other Linux users:

smbpasswd -a <username>

Disable logging in:

smbpasswd -d <username>

Enable logging in:

smbpasswd -e <username>

Delete user from Samba list:

smbpasswd -x <username>

Show currently opened files:


Scan network:


Copy files:

smbget -rR -u=<username> -p=<password> -w=<workgroup> smb://<host>/<share>
 -r - Automatically resume aborted files.
 -R - Recursive.
Default username: guest.