LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-12-2009, 10:21 PM   #1
jerf
Member
 
Registered: Sep 2007
Posts: 46

Rep: Reputation: 15
ssh troubles


Hi all,

I'm an inexperienced user experimenting with ssh and am having some difficulties that i havent been able to resolve. I'm trying from mac os x to a slackware box. After reading ssh tutorials and the man pages and such, when i try to connect to a machine on my local network I receive the following

$> ssh -v 192.168.x.x
OpenSSH_5.1p1, OpenSSL 0.9.7l 28 Sep 2006
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to 192.168.x.x [192.168.x.x] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /var/root/.ssh/id_rsa type -1
debug1: identity file /var/root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1
debug1: match: OpenSSH_5.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '192.168.x.x' is known and matches the RSA host key.
debug1: Found key in /var/root/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /var/root/.ssh/id_rsa
debug1: Trying private key: /var/root/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey,password).

and there Im stuck. I dont understand the debug messages and dont know what i need to fix in order to make it work.

Much thanks in advance.

Last edited by jerf; 06-18-2009 at 07:41 AM.
 
Old 06-13-2009, 07:01 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
This looks like you did not create keys for each user -- did you log in as "you" and run ssh-keygen? That creates the directory .ssh in your home directory with the public and private keys for your unique user ID on that unique machine (and, no, you cannot simply copy those to another box -- the keys are specific to user and machine). You can make your life a little easier if, when you run ssh-keygen, you simply hit the carriage return when you're prompted for a passphrase (otherwise you'll have to type it when you connect; just let SSH handle the secure connection).

Hope this helps some.
 
Old 06-13-2009, 08:45 AM   #3
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
The howto site I have used for a couple of years now is http://sial.org/howto/openssh/publickey-auth/.
 
Old 06-13-2009, 03:55 PM   #4
jerf
Member
 
Registered: Sep 2007
Posts: 46

Original Poster
Rep: Reputation: 15
I did run keygen on the mac and made sure that the slackbox had the same private and public keys, but being rather noobish I must have done something wrong in the process. Ill read up and dig back into those files to see where I went wrong.

Any ideas what the SSH2_MSG_NEWKEYS messages are about? Doesnt seem like we should be trying to get new keys but rather using the ones generated, but I really have no idea what those messages mean.

Thanks all.

Last edited by jerf; 06-13-2009 at 09:22 PM.
 
Old 06-13-2009, 09:53 PM   #5
jerf
Member
 
Registered: Sep 2007
Posts: 46

Original Poster
Rep: Reputation: 15
The site suggested doesnt work, the site is down or something because following the link or trying to get to sial and I get a "Service temporarily overloaded" message.

I'm curious as to how the authentication is supposed to be configured in sshd_config. I would like to use RSA (not sure what the difference is between dsa and rsa) I think, so does that mean that I need to have all the other auth types other than rsa set to 'no' in the config file? I thought I understood how this form of authentication works but Im obviously missing some very important concepts. Any elucidation would definitely be appreciated. Ill read up on it in the mean time.
 
Old 06-14-2009, 01:13 AM   #6
akiku
Member
 
Registered: Jun 2009
Distribution: Slackware
Posts: 62

Rep: Reputation: 17
jerf, sounds like there's some confusion with user keys, but you shouldn't need to mess with that if you're happy with password authentication.

Are the usernames the same in your mac and linux boxes?
If not, just specify a valid username and ssh will prompt you for the appropriate pwd, as in
Code:
ssh -l username 192.168.0.4
 
Old 06-14-2009, 03:17 PM   #7
jerf
Member
 
Registered: Sep 2007
Posts: 46

Original Poster
Rep: Reputation: 15
Thank you akiku. Your reply reminded me that I had changed around my sshd_config file disabling password authentication, I was trying to go straight for the rsa authenticating, and as a result was unable to establish an initial connection. Without that initial connection afforded by password auth, you cant copy public keys from one machine to another which ofcourse renders the key authentication impossible.

So Im now able to ssh from a mac running leopard to a slackware box, but am still having trouble going in the opposite direction with mac as the server instead of the client. Ive posted in some mac forums to try and resolve it. Ill post some links in case anyone can use them.

This one is for archlinux but is pretty much applicable unix wide and has great info.
http://home.comcast.net/~pudges-plac...ial_page1.html


and

http://www.stocksy.co.uk/articles/Mac/ssh_on_mac_os_x/

Last edited by jerf; 06-14-2009 at 03:27 PM.
 
Old 06-15-2009, 08:18 AM   #8
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
There are a couple of tricks you can do with SSH that may make your life a little more pleasant.

You probably know that you can copy a user's public key on machine A to the user's account on machine B (and vice-versa) so the user can connect without a password -- you copy the public key on machine A to ~/.ssh/authorized_keys on machine B (and the public key on machine B to ~/.ssh/authorized_keys on machine A). You can "enhance" the process by creating a ~/.ssh/config file (on both machines) with entries (in machine A's ~/.ssh/config file) like this
Code:
Host machineB
ForwardX11 yes
Compression yes
Protocol 2,1
User user_name_on_B

Host *
ForwardX11 no
You do the same on machine B, entering information for the user on machine A -- when you do this, things like scp, sftp and just plain old terminal use work for you with no fiddling around with passwords (and that's kind of the idea, eh?).

Another thing -- it looks like you might be using fixed IP addresses? If so, be sure and add the address and name to /etc/hosts which will make things a little easier. The form is
Code:
192.168.x.x     name.domain name
(use the actual node numbers, not x's and the name and domain that appear in /etc/HOSTNAME)
 
Old 06-15-2009, 04:58 PM   #9
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
If you have your ssh keys loaded (via ssh-agent) you can also just use "ssh-copy-id user@otherhost" to copy your public key into place and have the permissions set correctly.
 
Old 06-16-2009, 08:14 AM   #10
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Quote:
Originally Posted by jerf View Post
The site suggested doesnt work, the site is down or something because following the link or trying to get to sial and I get a "Service temporarily overloaded" message.
I'm not sure what was up with their site. It was like that for a day or two. Denial of service attack? Anyway, the site is working now. You should check it out. I've used it for a couple of years whenever I have to remind myself of details for ssl certs or ssh keys.

http://sial.org/howto/openssh/publickey-auth/
 
Old 06-18-2009, 07:29 AM   #11
jerf
Member
 
Registered: Sep 2007
Posts: 46

Original Poster
Rep: Reputation: 15
Thanks again everyone, this is all good stuff.

Anybody here good with mac os x? For some stupid reason I still cannot ssh into my mac from the slackbox. Its driving me nuts, and the only response Ive gotten from mac forums so far is "you have to allow remote login". Well I checked the little box and it aint workin. Seems like sshd isnt running because,

Quote:
$> ssh -v -l people 192.168.x.x
OpenSSH_5.1p1, OpenSSL 0.9.8i 15 Sep 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 192.168.x.x [192.168.x.x] port x.
debug1: connect to address 192.168.x.x port x: Connection refused
ssh: connect to host 192.168.x.x port x: Connection refused
but Ive tried
Quote:
/sbin/services ssh start
and allowing remote login under sharing preferences, but I'm not gettin anywhere.

I'm super happy I can finally ssh into my slackbox though. I couldnt figure it out myself for a long time. Me = hehe
 
Old 06-18-2009, 08:35 PM   #12
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Mac -- it partly depends on whether you are running Tiger or Leopard, because the arrangement of preferences and stuff changed between those two -- the firewall in particular.

In Leopard (I don't have a Tiger setup to check anymore), there are two places to check. In preferences, sharing, click on the check box to allow remote login. Make sure you allow all users or specify what account you will be logging in as. Then, in preferences, security, select the firewall tab and make sure you allow incoming connections. Make sure you also know what the short version of your user name is. While the Mac login will only show you the full name, if you pull up a terminal window, your prompt or home directory will show you what the short name is. That would be what you ssh in as.

If you've been messing around on the command line, then you could get yourself tangled up. I have edited the /etc/hosts.deny and /etc/hosts.allow; but, otherwise, after a stint of messing with the root account a couple of years ago, I have left off messing with that. You can use sudo just like you would in ubuntu. Your admin accounts are set up just like root in /etc/sudoers, with "%admin ALL=(ALL) ALL".

HTH
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 12:34 PM
troubles with SATA, troubles with NVIDIA aevangelica Linux - Hardware 6 10-17-2005 02:39 AM
SSH connect troubles... NOOB!! Mathijs Linux - Networking 7 03-14-2005 11:44 AM
SSH & Vsftpd Troubles Sabicas Linux - Networking 4 09-11-2004 11:21 PM
Troubles with SSH aeruzcar Linux - Software 3 07-11-2003 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration