0

Is there any way to get remote shell (not RDP) from home PC to office PC? i have 2 pc's on 2 different places pc number one ip : 66.33.22.885 ( home PC ) pc number tow ip : 77.13.85.676 ( office PC )

i want to connect from home to office via cmd not ( RDP ) how i can ??? and i dont know why they edited my post and delete it !!

Qassam Mahmoud
  • 993
  • 1
  • 8
  • 10
  • A) You're REALLY going to need to give more information here, and get more specific about what it is you're trying to do. Do you want a DOS prompt remotely accessible, or a Powershell prompt? Despite you saying it's not helpful, [WinRM](https://support.microsoft.com/kb/555966) does appear to be the Microsoft way to go about enabling a remote shell, though you could also do something like use [freeSSHd](http://www.freesshd.com/) B) What version of Windows are you running? – 0xDAFACADE Aug 17 '14 at 09:01
  • thanks man for replaying i wont to connect from home PC to office PC via CMD – Qassam Mahmoud Aug 17 '14 at 17:42
  • 2
    As for why the question had been edited: I was trying to clean up some formatting to make it more readable, as well as clean up the grammar, so that it would be clear to more people on the site to better help you get answers (and to meet quality expectations that the community has). It's not a personal affront, and you're free to accept the changes or not; just trying to help. If it was deleted, while I had nothing to do with that, I suspect it'd have been due to it not meeting the basic quality standards here: https://superuser.com/help/quality-standards-error – 0xDAFACADE Aug 17 '14 at 18:27

2 Answers2

2

Setting up the SSH Server

One way you can do this is with an SSH server installed and running on the PC you'd like to access. You can find a free one available here. While the setup process for it looks pretty straightforward, you can take a look at this how-to for a better understanding if you do choose to go with this particular software. Generally, the concepts in it will work for whatever SSH server you decide to go with.

Configuring the Network to allow connections through

If the computer is behind a router or firewall, you'll need to open up port TCP/22 (or whatever port you decide to run it on) so that the computer you're connecting from is able to access it. Instructions for how to do so vary widely from router to router, so you'll need to check your documentation for how to do so (though using a search engine for "<router type> port forwarding" will almost certainly work in lieu of official documentation). If for whatever reason you cannot do this (for example: you don't control your office firewall), you can take a look at how to do reverse SSH tunneling with PuTTY.

Connecting to the SSH Server

Once you have this set up, you can connect with an SSH client such as PuTTY. When you open putty, see a screen that looks roughly like this:

Putty

The important things to set when connecting for you will be:

1: Hostname or IP Address of the computer where the SSH server is running. 2: Specify connection type "SSH. 3. Ensure that the port number specified is the one you have the SSH server running on (and that you've opened on your firewall/router). If you didn't change it, then the default of "22" will be fine.

Once you click on "Connect" it will perform the initial connection, and on the first time only, will ask you if you wish to accept the server's key as valid. Most just answer yes here, but you can at this point do fingerprint validation to be absolutely sure you're connecting where you think you are (though this is outside of the scope of answering the question). After that, you'll be asked for a Username and Password. Supply these, hit 'enter' and you should be presented with a cmd shell.

NOTE: If you want to do this in both directions (from home -> office and from office -> home), you'll need a server set up on both computers, as well as the appropriate port forwarded on both firewall/router setups.

Other Options

If you insist on going with Microsoft based solutions only, you may want to take a look here to see how to use IPSec to provide an encrypted channel that you can use Telnet over. Expounding upon this further is definitely outside of my area of expertise, but the write up there seems to have all of the information you'd need to do it.

0xDAFACADE
  • 766
  • 3
  • 17
  • first off all thanks for replaying very quick second : i don't wont to use third party tools i mean i want to make connection via cmd by using windows default tools !! can i do what u said by using telnet ?? or TFTP ? – Qassam Mahmoud Aug 17 '14 at 18:52
  • 1
    Telnet is possible but HIGHLY not recommended over the open Internet, as it sends passwords in cleartext. If you were to use it over a VPN connection to provide the encryption layer, it could suffice. TFTP is not what you want at all, as it is used for transferring files over a UDP connection, rather than a remote terminal session. Microsoft does not officially have an SSH server (or client) available for Windows. You'd not be the first person to be a bit annoyed by this. – 0xDAFACADE Aug 17 '14 at 19:10
  • I've updated the answer with a link on how to use IPSec to encrypt Telnet if for whatever reason you must use Microsoft services only. It's quite a bit more complicated to set up, but should provide an alternative to third party tools that is workable. There are limitations to this method, which are why generally, using a third party SSH server is the preferred method. – 0xDAFACADE Aug 17 '14 at 19:17
  • im trying to prof something so lets focus on telnet i Know its 2 danger and it's not secure but i need it i need to t do this operation via telnet or any console third party tool ( not GUI ) so tell me about telnet becuse i spend 5 hours to do that without success , i disabled my firewall and i go to windows services and allow telnet and then i open 23 on my firewall but without success then i try to go to hots file and add my no-ip account there with my WAN ip and also i failed so what ur comment ? about psexec it's work very well on local network not over WAN – Qassam Mahmoud Aug 17 '14 at 19:18
  • For more in depth information on setting up Telnet, you'll have to wait for someone else to come along, as I haven't personally made use of a Telnet server in about 14 years at this point other than on a local network with Cisco networking equipmnent, and never on Windows. Just a warning though: it's pretty universally frowned upon to do, and you can probably expect that to be something you hear from just about everyone, as you're basically opening up a server and then openly passing around your password in a form that anyone with a sniffer can pick up, and have access to your machine. – 0xDAFACADE Aug 17 '14 at 19:22
  • okay man thanks very much i'll wait some one to explain about telnet ... if u have any idea about third party tool ( console tools ) to make remote connection over WAN tell me – Qassam Mahmoud Aug 17 '14 at 19:28
1

Setting up the Telnet service is not difficult. As stated in the comments to your question, it is not secure.

There are a number of steps which Ill describe below. See this MS article for details for each step.

Obviously, you need to forward the appropriate ports in your router/firewall.

Keltari
  • 71,875
  • 26
  • 179
  • 229
  • thanks man for ur replay but it didn't work also i still get this sucks error : Microsoft Telnet> o ( to ) 212.33.122.186 23 Connecting To 212.33.122.186...Could not open connection to the host, on port 23 : Connect failed Microsoft Telnet> – Qassam Mahmoud Aug 17 '14 at 20:11
  • make sure the port is open and redirecting to your pc. also make sure the firewall on the PC is allowing in port 23 – Keltari Aug 18 '14 at 00:56
  • yeah man thanks it's work now but its login to my router files :( not to my pc files :( – Qassam Mahmoud Aug 18 '14 at 06:39
  • yeah man thanks it's work now but its login to my router files :( not to my pc files :( i success to login to my computer files when i used telnet in local network but i want to use it over wan ( over internet ) when i want to connect its ask about password i write my Computer password it's log me in on my router files i dont know why , when i try to connect on local network not WAN the service ask for user name and password but when i use it for wan its ask for password only – Qassam Mahmoud Aug 18 '14 at 06:48