how to specify the port using ssh

Asked by hanadi

please i have a problem and hope an can help
i have connected from my laptop to a computer having public ip using ssh , the connection was done successfully since it asked me for the passoword
now i am connected at this pc when i wrote : ssh username@global ip
the problem i am facing now is that i want connect from this pc to another pc on the same local networkhaving the local ip of this new pc , i wrote
ssh -L 5900:localhost:5900 hanadi@ 10.170.8.39

but it gve me
connect to host 10.170.8.39 port 22: Connection refused
the question how can i connect to the pc with ip 10.170.8.39
from the pc which i conected to it from my laptop using ssh

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu openssh Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

A) your pc
B) your remote pc
B1) other remote pc on the same private lan network of B1

On the remote pc B1 you simple need to type:
ssh user@ip_of_pc_B1_on_the_remote_lan

But the pc B1 need to have a ssh server configured and up.

Hope this helps

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#2

Better
A) your pc
B) your remote pc
B1) other remote pc on the same private lan network of B1

On the remote pc B via ssh you simple need to type:
ssh user@ip_of_pc_B1_on_the_remote_lan

But the pc B1 need to have a ssh server configured and up.

Hope this helps

Revision history for this message
hanadi (hjeweidi75) said :
#3

thx for your help
B1 is pc having windows xp ubuntu is not installed
do we have to install it and install ssh server !
i hope there is solution with out installing it

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#4

I don't know Windows i think you can install some ssh-server on your Win (try Google) or use the no encryped telnet client from pc B to B1

telnet p_of_pc_B1_on_the_remote_lan

man telnet on pc B to get usage help

Hope this helps

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#5

Please tell what are you trying to do...?

Thank you

Revision history for this message
hanadi (hjeweidi75) said :
#6

i want to connect my ubuntu server to another windows pc
how can i do so ?
do i have to install samba ?
and how ?

Revision history for this message
hanadi (hjeweidi75) said :
#7

please i want to specify parametr while using ssh commnad
to connect my lapto to another pc through ubuntu server

the case is
i have laptop
ubuntus server
a pc
i have a public ip on the ubuntus server
and ubuntus server and a pc are locally connected (through network)

the case is i have to write ssh command that let me connect to the pc through the ubuntus server using the user id and password given to me (the laptop) to the server

i have the ip address of the pc and i think the port must be 22

what i need is the syntex

Revision history for this message
Ryan Dwyer (ryandwyer) said :
#8

Your Windows PC isn't running SSH. I'm not even sure if Windows can run SSH. You must do that first.

If you can get SSH running on Windows you could either:
a) set up another port forward in your router so port 122 goes to your Windows PC, then connect with ssh <external ip> -p 122
b) connect to the existing server via SSH then run ssh <local ip> inside the server's SSH session.

Revision history for this message
Jeruvy (jeruvy) said :
#9

Of course you can use SSH or run a SSH server on Windows :)

http://www.openssh.com/windows.html

Now I think hanadi you have the concept ok, but it would appear your firewall is blocking access. "Connection Refused" means that something (firewall) is explicitly refusing the connection.

Can you help with this problem?

Provide an answer of your own, or ask hanadi for more information if necessary.

To post a message you must log in.