VectorLinux
November 26, 2014, 06:35:20 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: ssh login problem  (Read 3142 times)
scififry
Member
*
Posts: 66


« on: July 18, 2011, 07:31:45 am »

Hello,

I've got a problem with ssh, it doesn't work properly. Undecided I created the keys as stated here -> http://www.linuxhelp.net/guides/ssh/
Code:
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:
ssh <user>@<hostip>
on my PartedMagic laptop, the shell responds with
Code:
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 Smiley
Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3192



« Reply #1 on: July 18, 2011, 07: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:
ssh yourname@your_server_ip
if 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:
ssh your_user_name@localhost
or
Code:
service sshd status
On 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.
Logged

scififry
Member
*
Posts: 66


« Reply #2 on: July 18, 2011, 07:53:31 am »

Thanks for your help, M0E! Smiley

Code:
root:# service sshd status
/usr/sbin/sshd is not running
No surprise that it doesn't work... Roll Eyes

Do I have to enable something first in the sshd configuration file?
Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3192



« Reply #3 on: July 18, 2011, 09:08:35 am »

Code:
service sshd restart
To 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:
service sshd {start|stop|restart|status}
which really just calls on the functions of /etc/rc.d/rc.sshd
Logged

scififry
Member
*
Posts: 66


« Reply #4 on: July 19, 2011, 11:38:27 am »

It works, now it's clear to me how to control ssh!
Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3192



« Reply #5 on: July 19, 2011, 11:56:54 am »

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:
cat key_file_name >> /home/<your_user_name>/.ssh/authorized_keys
After that, or a server restart, you should be able to login with keys.
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!