Форум русскоязычного сообщества Ubuntu


Считаете, что Ubuntu недостаточно дружелюбна к новичкам?
Помогите создать новое Руководство для новичков!

Автор Тема: Сменить права для /etc/sudoers  (Прочитано 3986 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн ARTGALGANO

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 1936
    • Просмотр профиля
Re: Сменить права для /etc/sudoers
« Ответ #15 : 04 Января 2017, 13:45:10 »


apt update
apt upgrade


dpkg -l sudo
??

dpkg-reconfigure sudo



что в sources.list?



Оффлайн riki-tik

  • Автор темы
  • Любитель
  • *
  • Сообщений: 56
    • Просмотр профиля
Re: Сменить права для /etc/sudoers
« Ответ #16 : 04 Января 2017, 14:07:49 »
apt update
Доходит только до:
Reading package lists... Done                                       
E: The repository 'http://ppa.launchpad.net/ondrej/php5/ubuntu xenial Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://download.opensuse.org/repositories/home:/olav-st/xUbuntu_16.04  Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1BE1E8D7A2B5E9D5
E: The repository 'http://download.opensuse.org/repositories/home:/olav-st/xUbuntu_16.04  Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

apt upgrade
Доходит до:
Setting up unattended-upgrades (0.90ubuntu0.3) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Errors were encountered while processing:
 sudo
E: Sub-process /usr/bin/dpkg returned an error code (1)

dpkg -l sudo
Выдает это:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
iU  sudo           1.8.16-0ubun amd64        Provide limited super user privil

dpkg-reconfigure sudo
Выдает:
/usr/sbin/dpkg-reconfigure: sudo is broken or not fully installed

Данные в source.list:
# deb http://by.archive.ubuntu.com/ubuntu/ xenial main restricted

# deb http://by.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb http://security.ubuntu.com/ubuntu xenial-security main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://by.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://by.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://by.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://by.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://by.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://by.archive.ubuntu.com/ubuntu/ xenial universe
deb http://by.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://by.archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://by.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://by.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://by.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://by.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://by.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://by.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
deb http://archive.canonical.com/ xenial partner
# deb-src http://archive.canonical.com/ xenial partner

toZen

  • Гость
Re: Сменить права для /etc/sudoers
« Ответ #17 : 04 Января 2017, 14:36:15 »
riki-tik,
# dpkg --purge --force-depends sudo# dpkg --configure -a# apt autoremove# apt autoclean# apt install sudosudo apt update ; sudo apt upgrade??
Фух...упарился тыркать пальцами в смарт..)))

### UPD ###
Я же говорил, что sudo грохнутое, ещё вчера говорил.
Да и судя по всему, я бы прошёлся напалмом по источникам.
sudo rm -f /etc/apt/sources.list.d/*
sudo apt update
« Последнее редактирование: 04 Января 2017, 16:21:21 от τοΖεη »

Оффлайн riki-tik

  • Автор темы
  • Любитель
  • *
  • Сообщений: 56
    • Просмотр профиля
Re: Сменить права для /etc/sudoers
« Ответ #18 : 04 Января 2017, 15:41:02 »
dpkg --purge --force-depends sudo
Возвращает:

dpkg: sudo: dependency problems, but removing anyway as you requested:
 ubuntu-minimal depends on sudo.

(Reading database ... 291531 files and directories currently installed.)
Removing sudo (1.8.16-0ubuntu1.2) ...
Purging configuration files for sudo (1.8.16-0ubuntu1.2) ...
dpkg: error processing package sudo (--purge):
 cannot remove old config file '/etc/sudoers' (= '/etc/sudoers'): Operation not permitted
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 sudo


dpkg--configure -a
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 ubuntu-minimal : Depends: sudo
E: Unmet dependencies. Try using -f.

apt install sudo
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-51 linux-headers-4.4.0-51-generic
  linux-image-4.4.0-51-generic linux-image-extra-4.4.0-51-generic
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
  sudo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/389 kB of archives.
After this operation, 1 618 kB of additional disk space will be used.
Selecting previously unselected package sudo.
(Reading database ... 291483 files and directories currently installed.)
Preparing to unpack .../sudo_1.8.16-0ubuntu1.2_amd64.deb ...
Unpacking sudo (1.8.16-0ubuntu1.2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up sudo (1.8.16-0ubuntu1.2) ...

Configuration file '/etc/sudoers'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** sudoers (Y/I/N/O/D/Z) [default=N] ? Y
dpkg: warning: sudo: failed to link '/etc/sudoers' to '/etc/sudoers.dpkg-old': Operation not permitted
Installing new version of config file /etc/sudoers ...
dpkg: error processing package sudo (--configure):
 unable to install '/etc/sudoers.dpkg-new' as '/etc/sudoers': Operation not permitted
Errors were encountered while processing:
 sudo
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo apt update ; sudo apt upgrade
Configuration file '/etc/sudoers'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** sudoers (Y/I/N/O/D/Z) [default=N] ? Y
dpkg: warning: sudo: failed to link '/etc/sudoers' to '/etc/sudoers.dpkg-old': Operation not permitted
Installing new version of config file /etc/sudoers ...
dpkg: error processing package sudo (--configure):
 unable to install '/etc/sudoers.dpkg-new' as '/etc/sudoers': Operation not permitted
Errors were encountered while processing:
 sudo
E: Sub-process /usr/bin/dpkg returned an error code (1)

Не понимаю почему почти в каждой операции у меня какие-то ошибки. Что пошло не так то?

sudo rm -f /etc/apt/sources.list.d/*
sudo apt update
То есть очистить список репозиториев? Это не опасно?

toZen

  • Гость
Re: Сменить права для /etc/sudoers
« Ответ #19 : 04 Января 2017, 16:33:51 »
riki-tik:idiot2:
У меня заканчиваются версии...
Попробуйте вручную передвинуть /etc/sudoers в /etc/sudoers.old и повторить операцию переустановки sudo.
Ндеюсь, Вы под рутом (su) всё проделывете?

Оффлайн riki-tik

  • Автор темы
  • Любитель
  • *
  • Сообщений: 56
    • Просмотр профиля
Re: Сменить права для /etc/sudoers
« Ответ #20 : 05 Января 2017, 11:02:18 »
Попробуйте вручную передвинуть /etc/sudoers в /etc/sudoers.old и повторить операцию переустановки sudo.
rm: cannot remove '/etc/sudoers': Operation not permitted
rm: cannot remove '/etc/sudoers.old': No such file or directory

Да, все от рута делаю

toZen

  • Гость
Re: Сменить права для /etc/sudoers
« Ответ #21 : 05 Января 2017, 11:04:39 »
riki-tik!!!!!!!
Не нужно rm!!!!!
sudo mv /etc/sudoers /etc/sudoers.old

Оффлайн riki-tik

  • Автор темы
  • Любитель
  • *
  • Сообщений: 56
    • Просмотр профиля
Re: Сменить права для /etc/sudoers
« Ответ #22 : 05 Января 2017, 11:27:21 »
Упс... Извиняюсь за глупость, хотел вообще удалить :|

sudo mv /etc/sudoers /etc/sudoers.old

mv: cannot move '/etc/sudoers' to '/etc/sudoers.old': Operation not permitted

toZen

  • Гость
Re: Сменить права для /etc/sudoers
« Ответ #23 : 05 Января 2017, 11:35:09 »
riki-tik, пошёл ломать систему воспроизводить Вашу проблему на одной из установленных систем. 
Уже самому интересно.
Будем пробовать решать?
Или будете переустанавливать?

Оффлайн ARTGALGANO

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 1936
    • Просмотр профиля
Re: Сменить права для /etc/sudoers
« Ответ #24 : 05 Января 2017, 11:51:36 »
верно, и мне интересно.
riki-tik,а покажите

lsattr /etc/sudoers

toZen

  • Гость
Re: Сменить права для /etc/sudoers
« Ответ #25 : 05 Января 2017, 12:07:29 »
riki-tik, умвр по:
sudo mv /etc/sudoers /etc/sudoers.oldОтрабатывает без ошибок и вопросов.
Идём дальше.

Оффлайн snowin

  • Активист
  • *
  • Сообщений: 885
    • Просмотр профиля
Re: Сменить права для /etc/sudoers
« Ответ #26 : 05 Января 2017, 12:09:39 »
E: The repository 'http://ppa.launchpad.net/ondrej/php5/ubuntu xenial Release' does not have a Release file.

прошу прощения, что вмешиваюсь
что еще за ondrej ???
почистили source.list ?


Оффлайн ARTGALGANO

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 1936
    • Просмотр профиля
Re: Сменить права для /etc/sudoers
« Ответ #27 : 05 Января 2017, 12:17:44 »
snowin,
там ище и от opensuse было
Цитировать
sudo mv /etc/sudoers /etc/sudoers.old
Отрабатывает без ошибок и вопросов.

верно, куда оно денется, если ток блокировок нет.



lsattr /etc/sudoers{,.d/*}

toZen

  • Гость
Re: Сменить права для /etc/sudoers
« Ответ #28 : 05 Января 2017, 12:23:01 »
У меня так:
┌─╼ [~]
└╼ sudo lsattr /etc/sudoers{,.d/*}
-------------e-- /etc/sudoers
-------------e-- /etc/sudoers.d/README

toZen

  • Гость
Re: Сменить права для /etc/sudoers
« Ответ #29 : 05 Января 2017, 12:33:14 »
ARTGALGANO, думаешь, ТС активировал <imunate> через chattr?
Интересная идея.
Сделал у себя
sudo chattr +i /etc/sudoersи конечно же получил запрет на перемещение.
Попробую произвести ещё пару операций.

### UPD ###
Походу, ты прав:
root@tozen:/home/tozen# dpkg --purge --force-depends sudo
dpkg: sudo: dependency problems, but removing anyway as you requested:
 ubuntu-minimal depends on sudo.
 gksu depends on sudo.

(Reading database ... 225094 files and directories currently installed.)
Removing sudo (1.8.16-0ubuntu1.2) ...
Purging configuration files for sudo (1.8.16-0ubuntu1.2) ...
dpkg: error processing package sudo (--purge):
 cannot remove old config file '/etc/sudoers' (= '/etc/sudoers'): Operation not permitted
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 sudo
root@tozen:/home/tozen# apt install sudo
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed
  sudo
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
Need to get 389 kB of archives.
After this operation, 1,618 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 sudo amd64 1.8.16-0ubuntu1.2 [389 kB]
Fetched 389 kB in 0s (987 kB/s)
Selecting previously unselected package sudo.
(Reading database ... 225046 files and directories currently installed.)
Preparing to unpack .../sudo_1.8.16-0ubuntu1.2_amd64.deb ...
Unpacking sudo (1.8.16-0ubuntu1.2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up sudo (1.8.16-0ubuntu1.2) ...
chown: changing ownership of '/etc/sudoers': Operation not permitted
dpkg: error processing package sudo (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 sudo
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@tozen:/home/tozen#
Выхлоп идентичен.
« Последнее редактирование: 05 Января 2017, 12:37:56 от τοΖεη »

 

Страница сгенерирована за 0.019 секунд. Запросов: 19.