Koozali.org: home of the SME Server

SSH remote login oddity

Offline toothandnail

  • ****
  • 139
  • +0/-0
SSH remote login oddity
« on: April 29, 2008, 04:06:52 PM »
My system is currently behind a dynamic IP, something I should be able to change fairly soon. However, in the meantime, I need access to a remote SME Server machine. To do this, I set up SSH access flowing the instructions here:

http://wiki.contribs.org/SSH_Public-Private_Keys#Installing_the_Public_Key_onto_the_Server

I already had the public/private key pair, and I have set the remote server manager to accept SSH connections from the internet, allow command line access, but not with normal passwords.

I added my public key to /root/.ssh/authorized_keys. Having done so, I can now log into the machine from here, which means I should be able to do the necessary admin work without too much compromise to its security.

I also added my public key to /home/e-smith/files/users/admin/.ssh/authorized_keys. However, any attempt to log in as admin results in an almost instant failure. The error I'm getting is this:

Code: [Select]
fang[~]$ ssh admin@mail.domain.co.uk
Permission denied (publickey).

I'm not even being prompted for my passphrase, so I'm not entirely sure whether the error is locally generated or comes from the remote server. As another test, I also copied my public key to /home/e-smith/files/users/paul/.ssh/auhorized_keys. If I attempt to login using that account, I get a different error:

Code: [Select]
fang[~]$ ssh paul@mail.domain.co.uk
Enter passphrase for key '/home/fang/.ssh/id_rsa':
Last login: Tue Apr 29 11:32:40 2008 from pc-00075.brillcomputers.co.uk
Connection to mail.brillcomputers.co.uk closed.

In this instance, I do get prompted for the passphrade, but the connection is closed immediately.

Initially, I tried setting the SSH access, but allowing log in with standard passwords. Decided that was too insecure to risk, so I changed it. However, before I changed it, I was able to log in as admin (in fact, I was able to login as admin, run the server manager and disable remote SSH access - suprised me a bit that it worked...). I didn't try logging in using my account name at that time.

Can anyone tell me what I have incorrectly set up, since I can no longer use an SSH login as admin? Also, from reading the wiki, I expected to be able to login from remote using just user@domain.co.uk. If I do that, the system simply sits. Logging in with user@mail.domain.co.uk works...

This is partially curiosity, since I don't expect to have to use this for very long, and I should be able to do all I need logged in as root. However, the behaviour seems a bit strange, so I wonder what I have failed to set up correctly.

paul

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: SSH remote login oddity
« Reply #1 on: April 29, 2008, 04:12:18 PM »
I'm not even being prompted for my passphrase, so I'm not entirely sure whether the error is locally generated or comes from the remote server. As another test, I also copied my public key to /home/e-smith/files/users/paul/.ssh/auhorized_keys. If I attempt to login using that account, I get a different error:
Don't know if this is an error as I had the same however it is easy to workaround. Log in as root and issue the following:

Code: [Select]
su admin

Edit: fixed command
« Last Edit: April 29, 2008, 04:39:05 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: SSH remote login oddity
« Reply #2 on: April 29, 2008, 04:16:25 PM »
I'm not even being prompted for my passphrase, so I'm not entirely sure whether the error is locally generated or comes from the remote server. As another test, I also copied my public key to /home/e-smith/files/users/paul/.ssh/auhorized_keys. If I attempt to login using that account, I get a different error:
Did you configure a shell for this user? You can make live much easier by installing the smeserver-remoteuseraccess contrib from smecontribs:

Code: [Select]
yum --enablerepo=smecontribs install smeserver-remoteuseraccess
More information: http://www.dungog.net/wiki/Smeserver-remoteuseraccess
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline toothandnail

  • ****
  • 139
  • +0/-0
Re: SSH remote login oddity
« Reply #3 on: April 29, 2008, 04:33:56 PM »
Don't know if this is an error as I had the same however it is easy to workaround. Log in as root and issue the following:

Code: [Select]
sudo admin

Thanks for the quick response. Tried that, but I'm getting 'sudo: admin: command not found'

paul.

Offline toothandnail

  • ****
  • 139
  • +0/-0
Re: SSH remote login oddity
« Reply #4 on: April 29, 2008, 04:36:51 PM »
Did you configure a shell for this user? You can make live much easier by installing the smeserver-remoteuseraccess contrib from smecontribs:

Code: [Select]
yum --enablerepo=smecontribs install smeserver-remoteuseraccess
More information: http://www.dungog.net/wiki/Smeserver-remoteuseraccess

 :oops: Completely forgot. So 'paul' has no shell. I'll have to fix that.

I'll also try the contrib - sounds like it could make life much easier. Thanks.

paul.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: SSH remote login oddity
« Reply #5 on: April 29, 2008, 04:38:19 PM »
Thanks for the quick response. Tried that, but I'm getting 'sudo: admin: command not found'

paul.
Oops:
Code: [Select]
su admin
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline toothandnail

  • ****
  • 139
  • +0/-0
Re: SSH remote login oddity
« Reply #6 on: April 29, 2008, 05:17:32 PM »
Oops:
Code: [Select]
su admin

 8-) Great, thanks. Works a treat. And is probably better than logging in as admin anyway.

One strange thing - guess its down to the recent update. The admin panel menu now seems to be lacking an exit option. I found that CTRL-ALT-BckSpace gets out of it, so its not major...

paul.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: SSH remote login oddity
« Reply #7 on: April 30, 2008, 08:47:27 AM »
One strange thing - guess its down to the recent update. The admin panel menu now seems to be lacking an exit option. I found that CTRL-ALT-BckSpace gets out of it, so its not major...

Have another good look please (imnage taken from the Administration Manual found in the wiki)... at the bottom of the screen the most right button of the two reads 'Exit'... what would that be used for you think??? :-D
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)