LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Using a shell remotely (https://www.linuxquestions.org/questions/linux-networking-3/using-a-shell-remotely-717806/)

jcafaro10 04-08-2009 05:45 PM

Using a shell remotely
 
I'm not sure if this is the right place to ask this. I'm new to linux and I'm doing some exploring on my Ubuntu virtual machine. If I bind a port to a shell, can someone connect to that shell and execute commands on it? Do they have to provide some sort of login information? If you have an ip address and port number, how do you get a remote shell? I am trying it just on my machine but I'm not sure how to get it work, or know that it's working b/c what's a remote shell on a local machine?

kenoshi 04-08-2009 05:54 PM

Most distros are pre-loaded with remote shell daemons, that is, you can connect it using a remote shell client, and login using whatever user login you have on that particular system.

In the old days, its rsh. Nowadays its ssh.

So for example, let's say I'm on a Linux box, and I want to login and start a remote shell on another Linux box, I would type at the prompt:
Code:

[myname@mybox ~]$ ssh myname@remoteserver
If you are doing this from a windows box to a Linux server, you would need to use a client like putty or secureCRT.

Hope this helps.

pentalive 04-08-2009 06:04 PM

Quote:

Originally Posted by jcafaro10 (Post 3502971)
...If I bind a port to a shell, can someone connect to that shell and execute commands on it? ...

Well, You can't "bind" a port to a shell.. How it is done is you have a program running in your machine watching for connections (actually there is a whole set of them but this is an overview..) It's called a Demon, and when one of two types of packets arrive at your machine it is what deals with them, creating a new shell and connecting it up. (lots of handwaving) The two kinds of packets are called Telnet or Secure Shell (SSH). SSH is better (more secure) and may even already be setup.

You will need to check the following things (no details yet..)

1) See that your firewall allows Telnet or SSH.
2) See that the xinetd demon is running (it watches the ports)
3) See that the Telnet or SSH demon is *enabled* (whichever is called by xinetd when a packet arrives for them)

SSH will demand credentials (usually it assumes your username is the same on both machines, and it just asks for "password for username@remotemachine:") As for telnet.. it's much less secure it may not even ask, been a long time since I have used telnet.

Sorry I don't have time for details beyond that. Hope it helps.


All times are GMT -5. The time now is 09:04 PM.