# emerging openssh over ssh

## ahuacatlan

Hi,

I'm trying to emerge openssh because my current version is outdated. But I only have access to this machine via the current version of ssh. When I try to emerge it, I get:

```
>>> Installing net-misc/openssh-5.1_p1-r1

 * >>> SetUID: [chmod go-r] /usr/lib/misc/ssh-keysign ...                                                                                                                                          [ ok ]

!!! Failed to move /var/tmp/portage/net-misc/openssh-5.1_p1-r1/image/usr/bin/ssh to /usr/bin/ssh

!!! [Errno 1] Operation not permitted

>>> Failed to install net-misc/openssh-5.1_p1-r1, Log file:

>>>  '/var/tmp/portage/net-misc/openssh-5.1_p1-r1/temp/build.log'
```

How can I emerge openssh while using openssh?

Thanks.

----------

## BonesToo

There shouldn't be anything wrong with emerging openssh over ssh.  I do it all the time.  You need to figure out what the root of the problem is.  Something else is causing the "Operation not permitted" error.  Any other emerge logs?

----------

## eccerr0r

Likely it's an extended attribute on the directory or file telling not to modify the file (if you didn't set it, then you have a whole another ball of wax to deal with).  May also want to check your dmesg log in case it's a failing disk that's causing the error.

I usually wait till I have physical access to the machine to upgrade sshd, as if it fails I'd not be able to do anything till then anyway...  Upgrading technically should be fine, it's restarting sshd that brings security and insecurity (as in, losing access to your machine.)

----------

## platojones

Are you logged in as root while doing this?

----------

## Hu

I would be surprised if he could run emerge without root privilege.  Also, I would expect it to fail with "Permission denied" if he somehow did manage to run emerge without root privileges.  I suspect that the file has somehow become immutable.  Consider:

```
# echo abc > foo

# chattr +i foo

# echo def > bar

# mv bar foo

mv: cannot move `bar' to `foo': Operation not permitted
```

As eccerr0r noted, unexpectedly immutable files are a very bad sign.  I can think of only three ways a file would become immutable: (1) an administrator made it immutable, (2) a malicious root-privileged user made it immutable to protect evil activity, or (3) a freak hardware failure changed that flag without causing enough corruption to trigger a detection event.

----------

