user login per ssh

HorstHansen

Neuer User
Mitglied seit
30 Mai 2008
Beiträge
38
Punkte für Reaktionen
0
Punkte
0
beim bauen der freetz firmware habe ich den dropbear-patch, der es lediglich root usern erlaubt, sich per ssh einzuloggen, entfernt. wenn ich nun versuche mich mit einem benutzer, den ich mittels 'adduser' erstellt habe, einzuloggen, sehe ich die motd, danach wird die verbindung geschlossen. woran liegt das?

vielen dank!

-horst
 
ja, homeverzeichnis existiert, rechte sind auch korrekt gesetzt. strace hab ich nicht mit drauf..
 
beim bauen der freetz firmware habe ich den dropbear-patch, der es lediglich root usern erlaubt, sich per ssh einzuloggen, entfernt. wenn ich nun versuche mich mit einem benutzer, den ich mittels 'adduser' erstellt habe, einzuloggen, sehe ich die motd, danach wird die verbindung geschlossen. woran liegt das?

vielen dank!

-horst
The user must have an available password.
 
Nun ja, mit strace könntest Du feststellen, was passiert. Vielleicht steht auch schon etwas im syslog.

So können wir nur weiter raten. Zum Beispiel, welche Shell ist für den Benutzer eingestellt?
 
leider habe ich immernoch keine ahnung woran es liegen könnte. habe bisher versucht, dem user ne andere shell zuzuweisen, verschiedene rechte fürs homeverzeichnis probiert, nach evtl zu restriktiven configfiles ausschau gehalten ;) - alles ohne erfolg. einloggen funktioniert zwar, nur wird die verbindung sofort wieder geschlossen. kann jemand bestätigen, _dass_ soetwas mit dieser konfiguration aufm fritzle überhaupt funktioniert? :)


joeblob@box69:~$ ssh fritz.box
[email protected]'s password:
__ _ __ __ ___ __
|__ |_) |__ |__ | /
| |\ |__ |__ | /_

The fun has just begun...
Connection to fritz.box closed.
joeblob@box69:~$
syslog:
Jun 15 10:31:00 fritz authpriv.notice dropbear[2384]: password auth succeeded for 'joeblob' from 10.0.0.2:51388
Jun 15 10:31:00 fritz authpriv.info dropbear[2384]: exit after auth (joeblob): Exited normally

desweiteren:

/var/mod/root # cat /etc/passwd
root:x:0:0:root:/mod/root:/bin/sh
ftpuser:any:1000:0:ftp user:/var/media/ftp:/bin/sh
joeblob:x:1001:1001:Linux User,,,:/home/joeblob:/bin/sh

/var/mod/root # cat /etc/shadow
root:<removed>:12332:0:99999:7:::
ftp:!:10957:0:99999:7:::
joeblob:<removed>:14045:0:99999:7:::

/var/mod/home # ls -l
drwxr-xr-x 2 1 users 0 Jan 1 2000 ftp
drwxr-sr-x 2 joeblob joeblob 0 Jun 15 10:29 joeblob


danke, horst hansen
 
Zuletzt bearbeitet:
hallo ralf,

hatte ich auch schon getestet, aber ich befürchte ich werde nicht um ein paar weitere tests herumkommen ;)

danke
 
Leider wird man ohne "replace kernel" nicht viel sehen, da der fork nicht getraced wird.

MfG Oliver
 
leider habe ich immernoch keine ahnung woran es liegen könnte. habe bisher versucht, dem user ne andere shell zuzuweisen, verschiedene rechte fürs homeverzeichnis probiert, nach evtl zu restriktiven configfiles ausschau gehalten ;) - alles ohne erfolg. einloggen funktioniert zwar, nur wird die verbindung sofort wieder geschlossen. kann jemand bestätigen, _dass_ soetwas mit dieser konfiguration aufm fritzle überhaupt funktioniert? :)

Execute ssh with the parameter '-v'. This may tell you why the connection is being capped. Also I think, ssh doesn't like suid/sgid bits in the permissions.

Here's the connection I captured
Code:
fritzbox@new-york:~/freetz/after-birth$ ssh -v root@de
OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to de [<7270 ip>] port <ssh port>.
debug1: Connection established.
debug1: identity file /home/fritzbox/.ssh/identity type -1
debug1: identity file /home/fritzbox/.ssh/id_rsa type -1
debug1: identity file /home/fritzbox/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version dropbear_0.51
debug1: no match: dropbear_0.51
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1.2
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: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host 'de' is known and matches the RSA host key.
debug1: Found key in /home/fritzbox/.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: /home/fritzbox/.ssh/identity
debug1: Trying private key: /home/fritzbox/.ssh/id_rsa
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
   __  _   __  __ ___ __
  |__ |_) |__ |__  |   /
  |   |\  |__ |__  |  /_

   The fun has just begun...


BusyBox v1.10.3 (2008-06-14 14:21:17 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

ermittle die aktuelle TTY
tty is "/dev/pts/0"
Console Ausgaben auf dieses Terminal umgelenkt
/var/mod/root # debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to de closed.
debug1: Transferred: stdin 0, stdout 0, stderr 26 bytes in 5.2 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 5.0
debug1: Exit status 0
 
this is how I logged in using a user (joeblob) - i can log in with root without any problems:

Code:
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/joeblob/.ssh/identity
debug1: Trying private key: /home/joeblob/.ssh/id_rsa
debug1: Trying private key: /home/joeblob/.ssh/id_dsa
debug1: Next authentication method: password
[email][email protected][/email]'s password: 
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
   __  _   __  __ ___ __
  |__ |_) |__ |__  |   /
  |   |\  |__ |__  |  /_

   The fun has just begun...
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to fritz.box closed.
debug1: Transferred: stdin 0, stdout 0, stderr 33 bytes in 0.1 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 416.6
debug1: Exit status 1

Thank you very much for your efforts. Let me know if you have any other
ideas.

Cheers,

Horst Hansen
 
I've logged in using ssh/root (this works perfectly well, as previously stated):

Code:
Console Ausgaben auf dieses Terminal umgelenkt
/var/mod/root # ls -al /dev/pts
drwxr-xr-x    2 root     root            0 Jan  1  2000 .
drwxr-xr-x    7 root     root            0 Jun 15 13:40 ..
crw--w--w-    1 root     root     136,   0 Jun 16 20:36 0
crw-r-----    1 root     root     136,   1 Jan  1  2000 1
crw-r-----    1 root     root     136,   2 Jan  1  2000 2
crw-r-----    1 root     root     136,   3 Jan  1  2000 3
crw-r-----    1 root     root     136,   4 Jan  1  2000 4
crw-r-----    1 root     root     136,   5 Jan  1  2000 5
crw-r-----    1 root     root     136,   6 Jan  1  2000 6
crw-r-----    1 root     root     136,   7 Jan  1  2000 7
 
I've logged in using ssh/root (this works perfectly well, as previously stated):

Normally, the login service will create these nodes as required. Log yourself out of every connection. Then in ruddi-shell do
Code:
rm -f /dev/pts/* &
. After that, try to log in using your problem child;)
 
having done that, I'm not getting further than that:

Code:
debug1: Next authentication method: password
[email protected]'s password: 
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8

edit:

syslog:

Code:
Jun 16 20:54:03 fritz authpriv.warn dropbear[1318]: pty_allocate: openpty: No such file or directory
Jun 16 20:54:03 fritz authpriv.warn dropbear[1318]: no pty was allocated, couldn't execute
 
could you please upload yours so I can fix my box again? :)
 
i know you can't log in with normal users without the patch applied. but i actually did apply the patch. now after having removed the files in /dev/pts/ as you suggested, I can not log in using root nor a normal user no matter if using ssh or telnet. could you please upload your files from /dev/pts/, so I can copy them over to my box using rudi-shell (I stupidly haven't backed them up before deleting them)? thanks.

edit: oh well, never mind, i rebooted and it's working again.
 
Zuletzt bearbeitet:
With mknod the pts character device nodes can be created by hand.

Usage: mknod [OPTIONS] NAME TYPE MAJOR MINOR
Create a special file (block, character, or pipe)

Options:
-m Create the special file using the specified mode (default a=rw)

TYPEs include:
b: Make a block (buffered) device
c or u: Make a character (un-buffered) device
p: Make a named pipe. MAJOR and MINOR are ignored for named pipes
 
Kostenlos!

Neueste Beiträge

Statistik des Forums

Themen
248,853
Beiträge
2,302,883
Mitglieder
378,501
Neuestes Mitglied
Dalle85