1

I'm having troubles to connect to my server via SSH. It runs Ubuntu 12.10. I can access the server using a normal user, but I can't access it using root. It seems ssh authenticates well, but the problem happens just after it let me in. Here's the output:

$ ssh root@myserver.dyndns.org
root@myserver.dyndns.org's password: 
*** invalid open call: O_CREAT without mode ***: sshd: root@pts/3 terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7ff1e31b9817]
/lib/x86_64-linux-gnu/libc.so.6(+0xeb7e1)[0x7ff1e319a7e1]
sshd: root@pts/3[0x41a542]
sshd: root@pts/3[0x41a9eb]
sshd: root@pts/3[0x41aeb8]
sshd: root@pts/3[0x409630]
sshd: root@pts/3[0x40f9ed]
sshd: root@pts/3[0x410dd6]
sshd: root@pts/3[0x411994]
sshd: root@pts/3[0x411f16]
sshd: root@pts/3[0x40b253]
sshd: root@pts/3[0x42be24]
sshd: root@pts/3[0x40c9cb]
sshd: root@pts/3[0x412199]
sshd: root@pts/3[0x4061a2]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7ff1e30d076d]
sshd: root@pts/3[0x407635]
======= Memory map: ========
00400000-00448000 r-xp 00000000 08:05 5914634                            /usr/sbin/sshd
00647000-00648000 r--p 00047000 08:05 5914634                            /usr/sbin/sshd
00648000-00649000 rw-p 00048000 08:05 5914634                            /usr/sbin/sshd
00649000-00750000 rw-p 00000000 00:00 0 
0104c000-0106d000 rw-p 00000000 00:00 0                                  [heap]
7ff1e1aef000-7ff1e1b04000 r-xp 00000000 08:05 4722225                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff1e1b04000-7ff1e1d03000 ---p 00015000 08:05 4722225                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff1e1d03000-7ff1e1d04000 r--p 00014000 08:05 4722225                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff1e1d04000-7ff1e1d05000 rw-p 00015000 08:05 4722225                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff1e1d05000-7ff1e1d07000 r-xp 00000000 08:05 4718645                    /lib/libnss_mdns4.so.2
7ff1e1d07000-7ff1e1f06000 ---p 00002000 08:05 4718645                    /lib/libnss_mdns4.so.2
7ff1e1f06000-7ff1e1f07000 r--p 00001000 08:05 4718645                    /lib/libnss_mdns4.so.2
7ff1e1f07000-7ff1e1f08000 rw-p 00002000 08:05 4718645                    /lib/libnss_mdns4.so.2
7ff1e1f08000-7ff1e1f20000 r-xp 00000000 08:05 4718655                    /lib/x86_64-linux-gnu/libresolv-2.15.so
7ff1e1f20000-7ff1e2120000 ---p 00018000 08:05 4718655                    /lib/x86_64-linux-gnu/libresolv-2.15.so
7ff1e2120000-7ff1e2121000 r--p 00018000 08:05 4718655                    /lib/x86_64-linux-gnu/libresolv-2.15.so
7ff1e2121000-7ff1e2122000 rw-p 00019000 08:05 4718655                    /lib/x86_64-linux-gnu/libresolv-2.15.so
7ff1e2122000-7ff1e2124000 rw-p 00000000 00:00 0 
7ff1e2124000-7ff1e212b000 r-xp 00000000 08:05 4722324                    /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7ff1e212b000-7ff1e232a000 ---p 00007000 08:05 4722324                    /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7ff1e232a000-7ff1e232b000 r--p 00006000 08:05 4722324                    /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7ff1e232b000-7ff1e232c000 rw-p 00007000 08:05 4722324                    /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7ff1e232c000-7ff1e232e000 r-xp 00000000 08:05 4718646                    /lib/libnss_mdns4_minimal.so.2
7ff1e232e000-7ff1e252d000 ---p 00002000 08:05 4718646                    /lib/libnss_mdns4_minimal.so.2
7ff1e252d000-7ff1e252e000 r--p 00001000 08:05 4718646                    /lib/libnss_mdns4_minimal.so.2
7ff1e252e000-7ff1e252f000 rw-p 00002000 08:05 4718646                    /lib/libnss_mdns4_minimal.so.2
7ff1e252f000-7ff1e266f000 rw-s 00000000 00:04 1104943                    /dev/zero (deleted)
7ff1e266f000-7ff1e267b000 r-xp 00000000 08:05 4722317                    /lib/x86_64-linux-gnu/libnss_files-2.15.so
7ff1e267b000-7ff1e287a000 ---p 0000c000 08:05 4722317                    /lib/x86_64-linux-gnu/libnss_files-2.15.so
7ff1e287a000-7ff1e287b000 r--p 0000b000 08:05 4722317                    /lib/x86_64-linux-gnu/libnss_files-2.15.so
7ff1e287b000-7ff1e287c000 rw-p 0000c000 08:05 4722317                    /lib/x86_64-linux-gnu/libnss_files-2.15.so
7ff1e287c000-7ff1e2886000 r-xp 00000000 08:05 4718664                    /lib/x86_64-linux-gnu/libnss_nis-2.15.so
7ff1e2886000-7ff1e2a86000 ---p 0000a000 08:05 4718664                    /lib/x86_64-linux-gnu/libnss_nis-2.15.so
7ff1e2a86000-7ff1e2a87000 r--p 0000a000 08:05 4718664                    /lib/x86_64-linux-gnu/libnss_nis-2.15.so
7ff1e2a87000-7ff1e2a88000 rw-p 0000b000 08:05 4718664                    /lib/x86_64-linux-gnu/libnss_nis-2.15.so
7ff1e2a88000-7ff1e2a9f000 r-xp 00000000 08:05 4722326                    /lib/x86_64-linux-gnu/libnsl-2.15.so
7ff1e2a9f000-7ff1e2c9e000 ---p 00017000 08:05 4722326                    /lib/x86_64-linux-gnu/libnsl-2.15.so
7ff1e2c9e000-7ff1e2c9f000 r--p 00016000 08:05 4722326                    /lib/x86_64-linux-gnu/libnsl-2.15.so
7ff1e2c9f000-7ff1e2ca0000 rw-p 00017000 08:05 4722326                    /lib/x86_64-linux-gnu/libnsl-2.15.so
7ff1e2ca0000-7ff1e2ca2000 rw-p 00000000 00:00 0 
7ff1e2ca2000-7ff1e2caa000 r-xp 00000000 08:05 4722318                    /lib/x86_64-linux-gnu/libnss_compat-2.15.so
7ff1e2caa000-7ff1e2ea9000 ---p 00008000 08:05 4722318                    /lib/x86_64-linux-gnu/libnss_compat-2.15.so
7ff1e2ea9000-7ff1e2eaa000 r--p 00007000 08:05 4722318                    /lib/x86_64-linux-gnu/libnss_compat-2.15.so
7ff1e2eaa000-7ff1e2eab000 rw-p 00008000 08:05 4722318                    /lib/x86_64-linux-gnu/libnss_compat-2.15.so
7ff1e2eab000-7ff1e2ead000 r-xp 00000000 08:05 4718631                    /lib/x86_64-linux-gnu/libdl-2.15.so
7ff1e2ead000-7ff1e30ad000 ---p 00002000 08:05 4718631                    /lib/x86_64-linux-gnu/libdl-2.15.so
7ff1e30ad000-7ff1e30ae000 r--p 00002000 08:05 4718631                    /lib/x86_64-linux-gnu/libdl-2.15.so
7ff1e30ae000-7ff1e30af000 rw-p 00003000 08:05 4718631                    /lib/x86_64-linux-gnu/libdl-2.15.so
7ff1e30af000-7ff1e3264000 r-xp 00000000 08:05 4718632                    /lib/x86_64-linux-gnu/libc-2.15.so
7ff1e3264000-7ff1e3463000 ---p 001b5000 08:05 4718632                    /lib/x86_64-linux-gnu/libc-2.15.so
7ff1e3463000-7ff1e3467000 r--p 001b4000 08:05 4718632                    /lib/x86_64-linux-gnu/libc-2.15.so
7ff1e3467000-7ff1e3469000 rw-p 001b8000 08:05 4718632                    /lib/x86_64-linux-gnu/libc-2.15.so
7ff1e3469000-7ff1e346e000 rw-p 00000000 00:00 0 
7ff1e346e000-7ff1e3477000 r-xp 00000000 08:05 4722316                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7ff1e3477000-7ff1e3677000 ---p 00009000 08:05 4722316                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7ff1e3677000-7ff1e3678000 r--p 00009000 08:05 4722316                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7ff1e3678000-7ff1e3679000 rw-p 0000a000 08:05 4722316                    /lib/x86_64-linux-gnu/libcrypt-2.15.so
7ff1e3679000-7ff1e36a7000 rw-p 00000000 00:00 0 Connection to myserver.dyndns.org closed.

Any idea of what to do? Thanks for your help!

Throoze
  • 201
  • 3
  • 11
  • Were you previously able to access the server (as root) successfully? Have there been any recent updates on the system? Are you able to access `root` by logging in as another user and then using `sudo` or `su`? Or are you locked out? – larsks Jul 30 '13 at 18:32
  • Yes, I was able to access as `root` before. I frequently upgrade the server, but don't know what broke ssh. I can access as a normal sudoer user, and then do `sudo su` to gain access to `root`. – Throoze Jul 30 '13 at 18:38
  • What is output of ssh -V ? –  Jul 30 '13 at 18:44
  • `OpenSSH_5.9p1, SSH protocols 1.5/2.0, OpenSSL 0x1000100f` – Throoze Jul 30 '13 at 18:45
  • [This post](http://ubuntuforums.org/archive/index.php/t-2066371.html) suggests that reinstalling the `openssh-server` package fixed the same error for someone else (on an older version of Ubuntu). Have you tried that yet? – larsks Jul 30 '13 at 19:11
  • @larsks: yes, but it doesn't let me reinstall it... it says `unable to make backup link of /usr/sbin/sshd: Operation Not permited`. I tried removing it, and when I wanted to install it again, It didn't let me install it because of the same file. So, it went worse :/ now I have no access at all :( Any idea? – Throoze Jul 30 '13 at 20:05
  • I don't want to be just a proxy for Google...have you looked up that error? That one seems to be pretty common along with some suggestions for correcting it. – larsks Jul 30 '13 at 20:21
  • yes, I had looked up in google before I asked here. The only suggestion I had found was the one you suggested. – Throoze Jul 30 '13 at 20:53
  • [This post](http://www.howtoforge.com/debian-ubuntu-unable-to-make-backup-link-of-usr-bin-sshd-before-installing-new-version-operation-not-permitted) solved my problem. It was the mentioned file which was preventing `aptitude` from properly upgrade `openssh-server`. Thanks for your help anyways! – Throoze Jul 30 '13 at 20:56
  • @Throoze The proper thing to do is to post an Answer stating how you fixed the problem. Welcome to Server Fault. – Michael Hampton Jul 31 '13 at 02:54
  • I'll post the answer ASAP. Normally, stackoverflow won't let me answer my own question until some prudential time. I assumed it would be the same here :) – Throoze Aug 01 '13 at 06:47

1 Answers1

4

This post solved my problem. It was because of the following files:

/usr/bin/ssh
/usr/sbin/sshd

which were preventing aptitude from properly upgrade openssh-server.

After following the instructions on the mentioned post, just did:

$ sudo aptitude reinstall openssh-server ssh

And problem solved!

Throoze
  • 201
  • 3
  • 11