FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 12-06-2009, 01:48 PM
Alan Mackenzie
 
Default Problems setting up sshd on an installation kernel

Hi, folks!

I'm trying to get sshd working on an embryonic Gentoo installation on my
laptop. The reason is that I want to ssh from my nice comfy desktop
system into this laptop to do the rest of the installation stuff.

The installation kernel with which I'm having problems is:
Linux livecd 2.6.30-gentoo-r8 #1 SMP Tue Nov 3 11:40:51 UTC 2009.

Having started sshd on my laptop, when I do

ssh -lroot 192.168.2.101

from my desktop, I get prompted for my ssh key's pass phrase, which I
enter. Thereafter, nothing happens, and it continues to happen for a
long, long time.

I've run sshd as sshd -d, which puts debugging info onto the screen. It
turns out my system can't create a pty "pseudo terminal". Here is the
debugging output. Please note the lines marked by "<=====":

Postponed publickey for root from 192.168.2.100 port 41130 ssh2
debug1: userauth-request for user root service ssh-connection method
publickey
debug1: attempt 2 failures 0
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: trying public key file /root/.ssh/authorized_keys
debug1: fd 4 clearing O_NONBLOCK
debug1: matching key found: file /root/.ssh/authorized_keys, line 1
Found matching DSA key: a8:6a:76:30:f8:a4:4e:c4:3b:cd:ba:3d:20:87:0c:8f
debug1: restore_uid: 0/0
debug1: ssh_dss_verify: signature correct
debug1: do_pam_account: called
Accepted publickey for root from 192.168.2.100 port 41130 ssh2
debug1: monitor_child_preauth: root has been authenticated by privileged
process
debug1: PAM: establishing credentials
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch_20
debug1: server_input_channel_open: ctype session rchan 0 win 65536 max
16384
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_channel_req: channel 0 request pty-req reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req pty-req
debug1: Allocating pty. <==========================
openpty: No such file or dIrectory <==========================
session_pty_req: session 0 alloc failed <==========================
debug1: server_input_channel_req: channel 0 request shell reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req shell
debug1: Forced command (key option) '/bin/bash'
Exiting on signal 2
debug1: do_cleanup
debug1: PAM: cleanup
debug1: PAM: deleting credentials
debug1: PAM: closing session

Clearly openpty (a C function) is failing to find some file. Don't you
just love error messages like "No such file or directory" which forget
to identify the filename? I'm guessing that the file it can't find is
the device file for the new pty.

Is there anything I can do to get sshd working from this kernel (and if
so, what?), or is there something fundamentally wrong with the kernel
configuration?

Thanks in advance for any and all help!

--
Alan Mackenzie (Nuremberg, Germany).
 
Old 12-06-2009, 03:28 PM
Mick
 
Default Problems setting up sshd on an installation kernel

On Sunday 06 December 2009 14:48:36 Alan Mackenzie wrote:

> Is there anything I can do to get sshd working from this kernel (and if
> so, what?), or is there something fundamentally wrong with the kernel
> configuration?

Not sure if this is a kernel problem. Have you tried to set up a user account
and passwd then login as a plain user over ssh and then su to root?
Alternatively, check /etc/ssh/sshd_config to see if root logins are disabled
as a default.

While you're there you may also/first want to disable pam for ssh just in case
it interferes with the root login.
--
Regards,
Mick
 
Old 12-06-2009, 03:59 PM
Florian Philipp
 
Default Problems setting up sshd on an installation kernel

Alan Mackenzie schrieb:
> Hi, folks!
>
> I'm trying to get sshd working on an embryonic Gentoo installation on my
> laptop. The reason is that I want to ssh from my nice comfy desktop
> system into this laptop to do the rest of the installation stuff.
>
> The installation kernel with which I'm having problems is:
> Linux livecd 2.6.30-gentoo-r8 #1 SMP Tue Nov 3 11:40:51 UTC 2009.
>
> Having started sshd on my laptop, when I do
>
> ssh -lroot 192.168.2.101
>
> from my desktop, I get prompted for my ssh key's pass phrase, which I
> enter. Thereafter, nothing happens, and it continues to happen for a
> long, long time.
>
[...]
>
> Clearly openpty (a C function) is failing to find some file. Don't you
> just love error messages like "No such file or directory" which forget
> to identify the filename? I'm guessing that the file it can't find is
> the device file for the new pty.
>
> Is there anything I can do to get sshd working from this kernel (and if
> so, what?), or is there something fundamentally wrong with the kernel
> configuration?
>

Where did you start sshd, in the chrooted environment or on the live cd
itself?
 
Old 12-06-2009, 05:36 PM
"Walter Dnes"
 
Default Problems setting up sshd on an installation kernel

On Sun, Dec 06, 2009 at 02:48:36PM +0000, Alan Mackenzie wrote
> Hi, folks!
>
> I'm trying to get sshd working on an embryonic Gentoo installation on my
> laptop. The reason is that I want to ssh from my nice comfy desktop
> system into this laptop to do the rest of the installation stuff.
>
> The installation kernel with which I'm having problems is:
> Linux livecd 2.6.30-gentoo-r8 #1 SMP Tue Nov 3 11:40:51 UTC 2009.
>
> Having started sshd on my laptop, when I do
>
> ssh -lroot 192.168.2.101
>
> from my desktop, I get prompted for my ssh key's pass phrase, which I
> enter. Thereafter, nothing happens, and it continues to happen for a
> long, long time.

Has your install gotten to the stage where you can chroot and emerge
and unmerge. If so, I would suggest the following...
1) unmerge pam. *DO NOT LOGOUT OR REBOOT*
2) put the line
sys-libs/pam
in /etc/portage/package.mask Create the file if it doesn't exist.
3) emerge shadow *BEFORE YOU LOG OUT OR REBOOT*.

Pam is an extra-high-security option that makes sense on a public
server with lots of people being able to log in. On a personal laptop
it is overkill. There was a comedy album once that was called...
"Everything You Know Is Wrong". That describes Pam. The security
settings for various services are in totally different files and
locations than normal.

Are you still booting from the install CD? The way you are running
sshd is not how the install manual suggests to do it. The webpage...
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=2
shows that you can pass the kernel options...

dosshd passwd=temppassword

at bootup, where "temppassword" is a temporary password. This allows
you to log in by typing the temporary password.

--
Walter Dnes <waltdnes@waltdnes.org>
 
Old 12-06-2009, 05:56 PM
Joshua Murphy
 
Default Problems setting up sshd on an installation kernel

On Sun, Dec 6, 2009 at 11:59 AM, Florian Philipp
<lists@f_philipp.fastmail.net> wrote:
> Alan Mackenzie schrieb:
>> Hi, folks!
>>
>> I'm trying to get sshd working on an embryonic Gentoo installation on my
>> laptop. *The reason is that I want to ssh from my nice comfy desktop
>> system into this laptop to do the rest of the installation stuff.
>>
>> The installation kernel with which I'm having problems is:
>> Linux livecd 2.6.30-gentoo-r8 #1 SMP Tue Nov 3 11:40:51 UTC 2009.
>>
>> Having started sshd on my laptop, when I do
>>
>> * * ssh -lroot 192.168.2.101
>>
>> from my desktop, I get prompted for my ssh key's pass phrase, which I
>> enter. *Thereafter, nothing happens, and it continues to happen for a
>> long, long time.
>>
> [...]
>>
>> Clearly openpty (a C function) is failing to find some file. *Don't you
>> just love error messages like "No such file or directory" which forget
>> to identify the filename? *I'm guessing that the file it can't find is
>> the device file for the new pty.
>>
>> Is there anything I can do to get sshd working from this kernel (and if
>> so, what?), or is there something fundamentally wrong with the kernel
>> configuration?
>>
>
> Where did you start sshd, in the chrooted environment or on the live cd
> itself?

My first thought as well... I'd guess, just at a glance, that sshd was
started in the chroot, and that /mnt/gentoo/dev/ is bind mounted
properly, but /mnt/gentoo/dev/pts/ isn't.

--
Poison [BLX]
Joshua M. Murphy
 
Old 12-06-2009, 07:17 PM
Alan Mackenzie
 
Default Problems setting up sshd on an installation kernel

Hi, Florian,

On Sun, Dec 06, 2009 at 05:59:00PM +0100, Florian Philipp wrote:
> Alan Mackenzie schrieb:

> > I'm trying to get sshd working on an embryonic Gentoo installation on
> > my laptop. The reason is that I want to ssh from my nice comfy
> > desktop system into this laptop to do the rest of the installation
> > stuff.

> > The installation kernel with which I'm having problems is:
> > Linux livecd 2.6.30-gentoo-r8 #1 SMP Tue Nov 3 11:40:51 UTC 2009.

> > Having started sshd on my laptop, when I do

> > ssh -lroot 192.168.2.101

> > from my desktop, I get prompted for my ssh key's pass phrase, which I
> > enter. Thereafter, nothing happens, and it continues to happen for a
> > long, long time.

> [...]

> > Clearly openpty (a C function) is failing to find some file. Don't
> > you just love error messages like "No such file or directory" which
> > forget to identify the filename? I'm guessing that the file it can't
> > find is the device file for the new pty.

> > Is there anything I can do to get sshd working from this kernel (and if
> > so, what?), or is there something fundamentally wrong with the kernel
> > configuration?


> Where did you start sshd, in the chrooted environment or on the live cd
> itself?

In the chrooted environment. When I start it directly in the live cd
session, it seems to work just fine.

When it works (from live cd), it creates a device file /dev/pts/0 in
(presumably) the installation ram disk. When it doesn't work (from
chrooted environment) it fails to create /dev/pts/0, even though /dev/pts
exists inside the chrooted root filesystem.

--
Alan Mackenzie (Nuremberg, Germany).
 
Old 12-06-2009, 07:23 PM
Alan Mackenzie
 
Default Problems setting up sshd on an installation kernel

Hi, Mick,

On Sun, Dec 06, 2009 at 04:28:10PM +0000, Mick wrote:
> On Sunday 06 December 2009 14:48:36 Alan Mackenzie wrote:

> > Is there anything I can do to get sshd working from this kernel (and
> > if so, what?), or is there something fundamentally wrong with the
> > kernel configuration?

> Not sure if this is a kernel problem. Have you tried to set up a user
> account and passwd then login as a plain user over ssh and then su to
> root?

No. Could that make a difference? It is prompting me for my key's
passphrase and accepts it; it is failing to create a pseudo terminal.

> Alternatively, check /etc/ssh/sshd_config to see if root logins are
> disabled as a default.

They are explicitly permitted. I set up sshd_config myself.

> While you're there you may also/first want to disable pam for ssh just in case
> it interferes with the root login.

Er, pam? That's when my ssh client prompts me for my pass phrase, isn't
it?

> Regards,
> Mick

--
Alan Mackenzie (Nuremberg, Germany).
 
Old 12-06-2009, 07:45 PM
Alan Mackenzie
 
Default Problems setting up sshd on an installation kernel

Hi, Joshua,

On Sun, Dec 06, 2009 at 01:56:06PM -0500, Joshua Murphy wrote:
> On Sun, Dec 6, 2009 at 11:59 AM, Florian Philipp
> <lists@f_philipp.fastmail.net> wrote:
> > Alan Mackenzie schrieb:

> >> I'm trying to get sshd working on an embryonic Gentoo installation on my
> >> laptop. *The reason is that I want to ssh from my nice comfy desktop
> >> system into this laptop to do the rest of the installation stuff.

> >> The installation kernel with which I'm having problems is:
> >> Linux livecd 2.6.30-gentoo-r8 #1 SMP Tue Nov 3 11:40:51 UTC 2009.

> >> Having started sshd on my laptop, when I do

> >> * * ssh -lroot 192.168.2.101

> >> from my desktop, I get prompted for my ssh key's pass phrase, which I
> >> enter. *Thereafter, nothing happens, and it continues to happen for a
> >> long, long time.

> > [...]

> >> Clearly openpty (a C function) is failing to find some file. *Don't you
> >> just love error messages like "No such file or directory" which forget
> >> to identify the filename? *I'm guessing that the file it can't find is
> >> the device file for the new pty.

> >> Is there anything I can do to get sshd working from this kernel (and if
> >> so, what?), or is there something fundamentally wrong with the kernel
> >> configuration?


> > Where did you start sshd, in the chrooted environment or on the live cd
> > itself?

> My first thought as well... I'd guess, just at a glance, that sshd was
> started in the chroot, and that /mnt/gentoo/dev/ is bind mounted
> properly, but /mnt/gentoo/dev/pts/ isn't.

It was, and it is, but it isn't, just as you suggest. I've just read up
on exactly what

mount -o bind /dev /mnt/gentoo/dev

means, and I can see I really want "-o rbind" (or --rbind) instead.

Thanks! It'll surely work, now

> Joshua M. Murphy

--
Alan Mackenzie (Nuremberg, Germany).
 
Old 12-06-2009, 08:31 PM
Joshua Murphy
 
Default Problems setting up sshd on an installation kernel

On Sun, Dec 6, 2009 at 1:36 PM, Walter Dnes <waltdnes@waltdnes.org> wrote:
> On Sun, Dec 06, 2009 at 02:48:36PM +0000, Alan Mackenzie wrote
>> Hi, folks!
>>
>> I'm trying to get sshd working on an embryonic Gentoo installation on my
>> laptop. *The reason is that I want to ssh from my nice comfy desktop
>> system into this laptop to do the rest of the installation stuff.
>>
>> The installation kernel with which I'm having problems is:
>> Linux livecd 2.6.30-gentoo-r8 #1 SMP Tue Nov 3 11:40:51 UTC 2009.
>>
>> Having started sshd on my laptop, when I do
>>
>> * * ssh -lroot 192.168.2.101
>>
>> from my desktop, I get prompted for my ssh key's pass phrase, which I
>> enter. *Thereafter, nothing happens, and it continues to happen for a
>> long, long time.
>
> *Has your install gotten to the stage where you can chroot and emerge
> and unmerge. *If so, I would suggest the following...
> *1) unmerge pam. **DO NOT LOGOUT OR REBOOT*
> *2) put the line
> sys-libs/pam
> * * in /etc/portage/package.mask Create the file if it doesn't exist.
> *3) emerge shadow *BEFORE YOU LOG OUT OR REBOOT*.
>
> *Pam is an extra-high-security option that makes sense on a public
> server with lots of people being able to log in. *On a personal laptop
> it is overkill. *There was a comedy album once that was called...
> "Everything You Know Is Wrong". *That describes Pam. *The security
> settings for various services are in totally different files and
> locations than normal.
>
> *Are you still booting from the install CD? The way you are running
> sshd is not how the install manual suggests to do it. *The webpage...
> http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=2
> shows that you can pass the kernel options...
>
> dosshd passwd=temppassword
>
> at bootup, where "temppassword" is a temporary password. *This allows
> you to log in by typing the temporary password.
>
> --
> Walter Dnes <waltdnes@waltdnes.org>

None of which would affect (failing) pty allocation... while I share
the disdain for PAM, it doesn't likely do a whole lot to fix the
problem at hand.

--
Poison [BLX]
Joshua M. Murphy
 
Old 12-06-2009, 08:49 PM
Boy Hartsuiker
 
Default Problems setting up sshd on an installation kernel

On Sun, Dec 06, 2009 at 02:48:36PM +0000, Alan Mackenzie wrote
> Hi, folks!
>
> I'm trying to get sshd working on an embryonic Gentoo installation on my
> laptop. The reason is that I want to ssh from my nice comfy desktop
> system into this laptop to do the rest of the installation stuff.
>
> The installation kernel with which I'm having problems is:
> Linux livecd 2.6.30-gentoo-r8 #1 SMP Tue Nov 3 11:40:51 UTC 2009.
>
> Having started sshd on my laptop, when I do
>
> ssh -lroot 192.168.2.101
>
> from my desktop, I get prompted for my ssh key's pass phrase, which I
> enter. Thereafter, nothing happens, and it continues to happen for a
> long, long time.

I experienced something similar once, because I copied a new fstab over
the default installed one. Be sure to have this line in /etc/fstab:

devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0
 

Thread Tools




All times are GMT. The time now is 05:22 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org