How to make a samba server available on internet with SSH - ssh

I have a local samba server running on my raspberry pi that I use as a NAS to share files with other devices on the network. How can I use SSH to make this accessible (with a password) over the internet so I can access my files from anywhere?

The ssh related part of this question has alread good answers in this superuser question.
I strongly recommend not to use username/password authentication for external access, but restrict the access with public/private keys.
And it is not a good idea to open the samba access to the internet, so this question is not related to samba and smb.
Another solution would be to install a NAS software on your device. The benefit will be, that you can access your files with a web browser, have user management and you can enable a lot of other functions.
You can try NextCloud, OwnCloud or alternatives.

Related

What are advantage of Isilon OneFS File System Access Api over accessing the file system using SMB or NFS?

I want to create some utility that read/write the files with permission (ACL) from/to Isilon server. This utility will access the server either on LAN or VPN. Here my main concern is to achieve performance too for file/folder enumeration and copy files data with attributes/acl/timestamp too.
As I know, you can access the file storage using SMB if server is on Windows server else NFS if server is on unix/linux.
so I want some basic information that in what scenarios OneFS Api's are better than accessing directly over NFS/SMB.
I'm an Isilon admin at a big company. TL;DR Its just another way to access your files
Most of my clients-systems access their files using SMB, and a smaller number use NFSv3. Generally NFS is best suited to Unix clients, and SMB is best with Windows, but you can mount SMB with Linux and you can run an NFS client on Windows. Probably the biggest advantage with NFS/SMB is they are commonly used protocols that most IT admins are familiar with.
API access would be the best approach if you are already writing custom software, or implementing a web framework that was geared toward REST API integration. If implementing using REST API, then Isilon's API access might be the easiest choice.

Login to raspberry pi running Windows IoT Core through public key authentication instead of password

I am currently using a Raspberry Pi3 running Windows Core IoT, and I can successfully log in using PuTTY as an SSH client, but it asks for a password. I was wondering if there is a way to use an RSA public key file for authentication instead of the password.
I know this can be done in linux with the authorized_keys file in the .ssh folder and changing the configuration file to allow such login method... Is there an equivalent procedure for Widnows Core IoT?
While I haven't been able to find anything about using keys, you could consider using KiTTY, a PuTTY fork.
Before I switched to linux full time, I used KiTTY, because it's much more configurable, and also allows stored plaintext passwords. It's much better than PuTTY, in my opinion.

Keeping a connection with remote computers

I have a series of RPi's running Raspian which need to deployed in various location around the world.
They will have internet access, but will all be behind a router. Is there an off-the-shelf solution to keep the possibility to create a SSH connection to them? I am thinking about solving problems, upgrading etc.
I am thinking of a 'server' solution where a 'client' on the RPi keep an active connection so a SSH connection can be established when required. Any suggestions will be much appreciated!
I have experimented with several services including LogMeIn Hamachi and Weaved among others. I would highly recommend using Weaved because it allows you to meet your goal (SSH to pi behind a router), and the setup is painless. You may even find some other uses that are quite handy.
See the installation details at https://developer.weaved.com/portal/members/betapi.php
Steps to be up and running:
Go to http://www.weaved.com and sign up.
Install weaved on your pi, and follow the prompts for SSH (Instructions at https://developer.weaved.com/portal/members/betapi.php).
Go to "My Devices" at weaved.com and get the new internet accessible proxy address for your pi.
Enjoy!

Setting up a server at home for Android app

I'm currently developing a simple multiplayer game app for Android and I need to have a server to which the users connect to.I'd like to set up this server at home. I have a dynamic IP address,so someone told me I'd have to set up a local DNS server or something like that. I'm not even sure where to start with setting up a DNS server, everything I found was for windows 2003 and linux. Nothing for XP? If any one can shed some light on this matter, explain a bit how setting a DNS works or supply a link with "setting up local DNS for dummies" I'd be grateful.
Also, besides setting up a DNS so I can find the server every time, how about the communication with it? I'd like for it to be as secure as possible. Another friend told me something about communicating via SSH, which is again something I am not accustomed to.
So if someone could explain some of these concepts or offer some GOOD link for that that would be great. I'm very confused :)
Thanks
EDIT
Btw, the server is in Java and currently i'm communicating from Android emulator to the server (which is localhost) via sockets.
That's not a simple thing you're trying to achive. First you have to create your own server on your machine (maybe you're done with this step), then you have to make this server available for everyone. At this point, I suggest the DynDNS service:
http://lifehacker.com/124804/geek-to-live--how-to-assign-a-domain-name-to-your-home-web-server
A local DNS by default help you to find your own servers by name instead of IP address, but if you have a usual internet service with dynamic IP, you need an external DNS provider to route your clients to your server. (read the link above for the full explanation)
About the SSH security: Yes, you will need some security settings indeed, but that could be a very hard problem sometimes. You can set your server to work with SSL sockets, which is a part of the core J2SE release. It will work against some sort of attack, but none against others. Running your own server will raise unexpected numbers of problems, prepare for that.
As already stated in the comment to your post, something like http://www.no-ip.com or http://www.dnsdynamic.org would solve the issue with your dynamic ip - You do not need a local DNS server.
With regards to communication, i believe that SSH is linux/unix only. Since you wish to use Windows for the server, FTP or Remote Desktop would be best. Choose FTP if all you want to do is manage your files, choose remote desktop if you wish to manage your entire computer. I've had good results with the FileZilla FTP server on windows (http://filezilla-project.org/)
With that said, i think you would be better off buying a simple and cheap hosted service instead of using your own computer - you can get something that can run your java app for $5/month some places, and compared with the annoyance of having a local server running in your house, it might be worth it.

What API can be used to change windows account information remotely?

What API is available to change windows account passwords remotely? Assuming I have the proper credentials to change the windows accounts, I need to write software that can do so remotely.
The software will run on Linux, and so far it appears that SMB may have some functionality in this area, but I need either an API, library, code, or even the right key words to help me figure out how to search for solutions or an approach to solving this problem.
I've found Wmi client on Linux but as far as I understand there seems to be issues with it.
Try:
smbpasswd -r machine -U user.
You can use wmi-client, but on the other hand that does not work on windows 2008 server with domain controller and the password is passed in the network without encryption.
The smbpasswd command that is part of Samba allows you to change the password on remote machines. E.g.
smbpasswd -r MACHINE -U USER
You should be able to just invoke that command from your favorite programming language; the next version of Samba will have some Python APIs that probably also allow you to do this from within Python.