Work on home server over the internet?

0

I was wondering how I could safely and securely perform SFTP throught the internet to my server so that I could work in code from home. Should the data be encrypted and tunneled? I don't have an exact idea. Which ports should the server have open? ( I would also need SSH... or similar...)

Fane

Posted 2015-09-06T08:35:58.060

Reputation: 113

sftp is file transfed over ssh so if you have secure password, it is secure by definition. SSH uses port 22 by default. – Jakuje – 2015-09-06T08:53:03.847

@Jakuje So I should open port 22 and I'm ready to go to use it anywhere? What about MITM attacks? – Fane – 2015-09-06T08:54:50.433

If you note fingerprint of you host key and verify it once, it is safe. Or you can just copy over the whole server public key using secure channel (flash drive?). – Jakuje – 2015-09-06T08:59:12.050

Answers

0

Set up an SSH server, that's the server side of SFTP.

openssh includes a client and server and an sftp command you use at the client side. I am not sure about other implementations.. You can install openssh with cygwin.

The connection will be encrypted when you have the SSH server. The encryption helps stop MITM attacks. You wouldn't be using tunneling. Tunneling is when you make a connection through the connection. (tunneling the connection within the encrypted connection/tunnel)

barlop

Posted 2015-09-06T08:35:58.060

Reputation: 18 677

I see... thanks for your help. Do you know the wireless service eduroam? This being their list of available ports how would there be any problem on using sftp? And if so, how could I counter it? On top of that, if I need to run a stream socket port (I run it in 3000 in my home set) in which port should I run it? Available ports

– Fane – 2015-09-06T10:27:02.590

(I guess it's a awireless router you connect to for internet access?)well, re that pic showing what ports they allow on their wireless router,They allow anybody to make an outgoing connection on port 22,so if you connect to their wireless router then you will be able to connect to any ssh / sftp server. But if you want to run an ssh server or any server which connects to the internet by connecting to their wireless router, then it is under a router you can't control that blocks a lot e.g. blocks incoming, so you will need to do some cleverness(maybe a reverse tunnel), which I can explain. – barlop – 2015-09-06T10:46:31.540

But if your ssh server is behind a firewall/router that you control then you will have no problem connecting your computer to their wireless router for internet access, and then connecting to the SSH server. – barlop – 2015-09-06T10:47:09.440

If you want to run any server on your computer where the computer running the server is behind a router you can't control e.g. say it's a streaming server, then you have to do it by a reverse tunnel. Say you have your home computer that you can control, it doesn't have the streaming server, it connects to itself which gets forwarded, tunnelled through the ssh connection, to the streaming server. So the ssh connection goes one way and the tunnelled connection is going to have to go the other way. So it' a reverse tunnel – barlop – 2015-09-06T10:57:36.560

@Fane This may help, note it's not simple http://stackoverflow.com/questions/842021/ssh-d-port-usernameserver-com-but-in-reverse

– barlop – 2015-09-06T11:01:22.670

So, by the actual configs of the network, if I open the connection would I be able to edit code hosted on the server? And regarding openssh what I would need is to connect to the server via ssh and then put the node instance to run via a command in the terminal. It would be running on the home server to the home router, but initiated elsewhere through the command, if i made my point... would both these work without R tunneling? (thank you so much for your help you are being so kind) – Fane – 2015-09-06T11:19:33.113

The wireless router that you cannot control(eduroam), cannot stop you editing files on the server you connect to. The network can only allow or stop the connection. You would use an SSH server. And then either an SSH client or an SFTP client. Practice something simple first, e.g. set up an SSH server at home, Then connect a computer to the wireless router that you don't control and just SSH to home. – barlop – 2015-09-06T12:17:28.427

Also, try to look for correct terminology and not invent your own. Using terms like "node instance" and running a node instance, are all terms you are making up. Try to make an effort to use and learn proper terminology. Or use regular terms like "computer".. not "node instance". – barlop – 2015-09-06T12:19:19.313

@Fane Do comment on your progress, i'm happy to explain things. And remember that any question you ask or anything you misunderstand, is beneficial to others.And also,bear in mind that it takes me just seconds to correct poor terminology or to identify and correct misunderstandings, it's easy for me to do,I can do it with my eyes closed.. And if you understand it then you can explain it to others perhaps in your work place if they are stuck..So we all benefit. When I ask questions, I do it knowing that by even asking,I am adding to the pool of knowledge. By getting an explanation,I am adding. – barlop – 2015-09-06T19:50:13.007