VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: ssh login problem  (Read 3532 times)

scififry

  • Member
  • *
  • Posts: 66
ssh login problem
« on: July 18, 2011, 08:31:45 am »

Hello,

I've got a problem with ssh, it doesn't work properly. :-\ I created the keys as stated here -> http://www.linuxhelp.net/guides/ssh/
Code: [Select]
ssh-keygen -b 1024 -f /etc/ssh_host_key -N '', but even after that it doesn't work.
I want to use ssh to exchange some files between my laptop and my computer. After typing
Code: [Select]
ssh <user>@<hostip>on my PartedMagic laptop, the shell responds with
Code: [Select]
ssh: connect to host ip.ip.ip.ip port 22: Connection refused Port 22 of my VL firewall is opened, and the connection works in one way: Logging into PartedMagic running on my laptop with my VL 6.0 computer.

Thanks in advance for help :)
Logged

M0E-lnx

  • Administrator
  • Vectorian
  • *****
  • Posts: 3257
Re: ssh login problem
« Reply #1 on: July 18, 2011, 08:41:09 am »

You have to take this one step at a time.
You say your login is not working, but you have a problem with your keys.

Re: SSH
You must get your server to work properly first before you setup key-based logins. ie, if your server refuses the connection, there is just no way to get in. 

You should be able to connect from any client with
Code: [Select]
ssh yourname@your_server_ipif the server listens on port 22, then you do not need to specify a port, as ssh defaults to 22, otherwise, use the '-p [PORT_NUMBER]' flag on the connect command.

Make sure the server is up and running. Test using
Code: [Select]
ssh your_user_name@localhost or
Code: [Select]
service sshd statusOn the default Vectorlinux 6 and 7 configuration, this should work.  If you added firewalls after your default installation, try disabling your firewall and try to connect again to make sure your problem is really the ssh setup and not the firewall setup.

After you got the server responding and you're sure it's not a firewall problem, post back and i'll tell you how to setup your key-based login.

scififry

  • Member
  • *
  • Posts: 66
Re: ssh login problem
« Reply #2 on: July 18, 2011, 08:53:31 am »

Thanks for your help, M0E! :)

Code: [Select]
root:# service sshd status
/usr/sbin/sshd is not running
No surprise that it doesn't work... ::)

Do I have to enable something first in the sshd configuration file?
Logged

M0E-lnx

  • Administrator
  • Vectorian
  • *****
  • Posts: 3257
Re: ssh login problem
« Reply #3 on: July 18, 2011, 10:08:35 am »

Code: [Select]
service sshd restartTo have the ssh server start automatically when your computer boots, run vasm as root and go here
SERVICE -> SRVSET -> 4 -> and make sure sshd is enabled (it should have a * by it)
after that sshd should start up automatically.  The configuration file only controls the daemon's behaviour, not it's start/stop functions.  That is controlled by
Code: [Select]
service sshd {start|stop|restart|status} which really just calls on the functions of /etc/rc.d/rc.sshd

scififry

  • Member
  • *
  • Posts: 66
Re: ssh login problem
« Reply #4 on: July 19, 2011, 12:38:27 pm »

It works, now it's clear to me how to control ssh!
Logged

M0E-lnx

  • Administrator
  • Vectorian
  • *****
  • Posts: 3257
Re: ssh login problem
« Reply #5 on: July 19, 2011, 12:56:54 pm »

For key-based login, all you have to do is copy the public key from the client over to the server
and once you have it there do
Code: [Select]
cat key_file_name >> /home/<your_user_name>/.ssh/authorized_keysAfter that, or a server restart, you should be able to login with keys.