Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16
Can i connect by a pc to an other with ssh and after to use ssh by second pc to connect to third pc? if yes, the pcs must be ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    24

    ssh


    Can i connect by a pc to an other with ssh and after to use ssh by second pc to connect to third pc?

    if yes, the pcs must be as simple pcs or i must configure them for ssh operation?

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,442
    yes.
    The second and third machine need to run a ssh daemon.

    Of course you need network connectivity (routing/firewall/vpn) to
    and means of authentication (authorized keys/account/etc) for these two ssh daemons.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Jun 2010
    Posts
    24
    thanks. i want more details because i have not big enough exp to do that.

    for example: what i must do for the second pc so that connect by first to second pc?

    i must make a classical user accound? And On which state must be find the second pc so that connect with fisrt?

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,442
    Install the sshd daemon with the package manager of your linux distribution (which one do you have?).
    Code:
    yum install openssh-server
    or
    apt-get install openssh-server
    Start the daemon
    Code:
    /etc/init.d/sshd start
    If your client machine and the machine running the sshd are in the same network, then this is already enough.
    Any user should be able to connect with
    Code:
    ssh <user>@<sshd-machine>
    Note, that sometimes the sshd config forbids root logins to heightein security a little bit.
    As in:
    An attacker would need two credentials to get root access instead of one
    You must always face the curtain with a bow.

  6. #5
    Just Joined!
    Join Date
    Jun 2010
    Posts
    24
    ok. the sshd is in my machine. I do some confiquration in sshd_config. I make a user account (username:test) and i put allowuser test at the end of config file .
    Now when i try(by other ip) to connect with:
    ssh -p 22 test@my ip itake the error that no root, no host
    why?

  7. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    1. allowuser test would not work in sshd_config. you want AllowUsers test (it is case-insensitive, but the ending s is required).

    man sshd_config for more details

    2. You need to restart the SSH daemon after modifying sshd_config - if you had, you would have seen it fail to start b/c of the misconfiguration.

    Can you print the exact SSH command that you attempted and also the exact SSH error message? What you've shown is a bit confusing.

    Also just try logging in as your test user from the local machine first, e.g.:
    Code:
    ssh test@localhost

  8. #7
    Just Joined!
    Join Date
    Jun 2010
    Posts
    24
    tell me if i do anywhere wrong.

    1. i use: ssh test@(external ip of router where at each connection is different due to DHCP)

    2. the test user is created as simple user of linux (useradd...)

    3. i have disable the firewall (but i have run all procedure and with firewall without difs).

    here i have tried to connect by other pc (connection):
    an i took the follow mes (the xxx.xx... is external ip):

    ssh: connect to host xxx..xxx.xxx.xxx port 22: Connection timed out

    Maybe i have non configure well my config file? can you send me a example for my use?

  9. #8
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,442
    The sshd is either not running or not reachable.

    On the machine, can you see the daemon?
    Code:
    netstat -tunlp |grep ssh
    You must always face the curtain with a bow.

  10. #9
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Did you try to SSH in from the same machine that your SSH daemon is running on(ssh test@localhost)?

    From your client PC, can you ping the SSH server PC?

  11. #10
    Just Joined!
    Join Date
    Jun 2010
    Posts
    24
    the deamon ( netstate) give:

    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2858/sshd

    what is mean this?


    Also, i have only put the external ip at ssh . Is not necessary the internal ip by router to host?

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •