Estou usando o Ubuntu 18.04 bionic e instalei o pacote xfce4. No entanto, quando escolho "sessão do Xfce" no gerenciador de login, ele não me conecta ao Xfce4, mas me leva de volta à janela de login. Por que isso acontece e como posso corrigi-lo?
stdcerr's questions
Onde posso ver a configuração padrão do Xenial
kernel? Estou particularmente interessado na configuração de gerenciamento de energia USB, incluindo:
CONFIG_SUSPEND
CONFIG_HIBERNATION
CONFIG_PM_RUNTIME
CONFIG_PM
eCONFIG_USB_SUSPEND
uname -r
me dá: 4.4.38-l4t-r28.2+g174510d
Eu tenho problemas para redefinir a senha de root do meu servidor mysql no Ubuntu 19.10: eu segui as instruções em https://websiteforstudents.com/resetting-mysql-root-password-on-ubuntu-16-04-17-10-and- 18-04-lts/ e tudo corre como as instruções dizem até chegar ao passo em que devo fazer o login com sudo mysql -u root
. Estou tendo o erro a seguir:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Eu verifiquei meus endereços de ligação em /etc/mysql/mysql.conf.d/mysqld.cnf
. Eu tenho três, eles estão definidos para:
127.0.0.1,
10.0.2.15 (my local ethernet iface) and
0.0.0.0
então eu não sei porque ele não me deixa conectar, alguma dica? Eu configurei
sudo ufw enable
& sudo ufw allow mysql
- mesmo depois sudo ufw disablle
de não me deixar conectar!
Finalmente consegui atualizar minha máquina desktop de 16.04 para 18.04.
E como esperado as coisas não ficaram tão perfeitas. Bem, meu computador ficou travado e não consegui mais desbloqueá-lo depois de iniciar a atualização (então o deixei lá por cerca de 24 horas). E após uma reinicialização, ele fica preso após a tela de login, mudar para um shell me dá:
$ sudo apt update;sudo apt -y upgrade
[sudo] password for ron:
...
...
E: Unmet dependencies. Try using -f.
ron@ronDesktopHome:~$ sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
alembic calligraflow-data calligrawords-common cgmanager dh-python dleyna-server elks-libc emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacs24-el
evolution-data-server-online-accounts fonts-font-awesome fonts-roboto-unhinted fonts-texgyre gcc-5-base:i386 gcc-6-base:i386 gir1.2-notify-0.7 imagemagick-common
kde-style-qtcurve kwin-style-qtcurve libapache2-mod-wsgi-py3 libautodie-perl libblas-common libbotan-1.10-1 libcauchy0.0v5 libclang1-3.6 libcloog-isl4
libconfig-file-perl libdata-alias-perl libdleyna-connector-dbus-1.0-1 libdleyna-core-1.0-3 libedataserverui-1.2-1 libextutils-depends-perl
libextutils-pkgconfig-perl libgdbussyncevo0 libgeos-3.5.0 libgl2ps0 libgoocanvas-common libgoocanvas3 libgps22 libgrilo-0.2-1 libgupnp-av-1.0-2 libgupnp-dlna-2.0-3
libgweather-3-6 libidn11:i386 libieee1284-3:i386 libio-multiplex-perl libjasper-dev libjavascriptcoregtk-3.0-0 libkadm5clnt-mit9 libkdcraw-data libkdcraw23
libkf5activitiesexperimentalstats1 libkf5dbusaddons-bin libkf5iconthemes-bin libkf5prison1 libkf5xmlrpcclient-data libkf5xmlrpcclient5 libkqoauth0 libkvkontakte1
liblivemedia50 libllvm3.6v5 libllvm6.0:i386 libm2mml0.0v5 libmediawiki1 libnet-cidr-perl libnet-server-perl libopencv-calib3d2.4v5 libopencv-contrib2.4v5
libopencv-features2d2.4v5 libopencv-flann2.4v5 libopencv-gpu2.4v5 libopencv-legacy2.4v5 libopencv-ml2.4v5 libopencv-ocl2.4v5 libopencv-photo2.4v5
libopencv-stitching2.4v5 libopencv-superres2.4v5 libopencv-ts2.4v5 libopencv-videostab2.4v5 libopencv2.4-jni libparams-validate-perl libphononexperimental4
libprocps4 libpst4 libqbscore1 libqbsqtprofilesetup1 libqt5clucene5 libqtgstreamer-1.0-0 libqtgstreamerutils-1.0-0 librpm3 librpmbuild3 librpmio3 librpmsign3
libsasl2-modules:i386 libsyncevo-dbus0 libustr-1.0-1 libvoikko1 libvpx3:i386 libwacom-bin libwebkitgtk-3.0-0 libwebpdemux1 libxapian-1.3-5 pgadmin4-doc
python-alembic python-babel-localedata python-gi-dev python-mako python-markupsafe python-sqlalchemy python-sqlalchemy-ext python3-alembic python3-babel
python3-blinker python3-crypto python3-dbus.mainloop.qt python3-ecdsa python3-flask python3-flask-babelex python3-flask-gravatar python3-flask-htmlmin
python3-flask-login python3-flask-mail python3-flask-migrate python3-flask-paranoid python3-flask-principal python3-flask-script python3-flask-security
python3-flask-sqlalchemy python3-flaskext.wtf python3-htmlmin python3-itsdangerous python3-jinja2 python3-paramiko python3-passlib python3-pyasn1 python3-pyinotify
python3-simplejson python3-sqlalchemy python3-sqlparse python3-sshtunnel python3-werkzeug python3-wtforms qml-module-org-kde-runnermodel qml-modules-org-kde-purpose
rename sonnet-plugins system-config-printer-gnome
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
apt apt-transport-https apt-utils aptitude aptitude-common cups-common emacs25 emacs25-bin-common emacs25-common gir1.2-gconf-2.0 gir1.2-glib-2.0
gobject-introspection imagemagick imagemagick-6.q16 libaribb24-0 libbasicusageenvironment1 libboost-filesystem1.65.1 libboost-iostreams1.65.1 libcupsfilters-dev
libcupsimage2-dev libdevmapper1.02.1 libebml4v5 libgirepository-1.0-1 libgroupsock8 libgutenprint2 liblirc-client0 liblircclient0 liblivemedia62
libmagickcore-6.q16-3-extra libmatroska6v5 libmicrodns0 libnfs11 libopenmpt-modplug1 libplacebo4 libpng-dev libpng-tools libprotobuf-lite10 libpython3.6-minimal
libsidplay2 libusageenvironment3 libva-wayland2 libvlc-bin libvlc-dev libvlc5 libvlccore-dev libvlccore9 obex-data-server openmpi-bin openmpi-common
python3.6-minimal vlc-bin vlc-data vlc-plugin-base vlc-plugin-notify vlc-plugin-qt vlc-plugin-samba vlc-plugin-video-output
Suggested packages:
apt-doc aptitude-doc-en | aptitude-doc debtags emacs25-common-non-dfsg imagemagick-doc autotrace curl enscript gnuplot grads hp2xx html2ps povray radiance
ufraw-batch gutenprint-locales lirc libjxr-tools libdvdcss2
Recommended packages:
emacs25-el dmsetup
The following packages will be REMOVED:
emacs emacs24 libpng12-dev libreoffice libsidplay2v5 libvlccore8 pgadmin4 systemd-shim update-manager-kde vlc-nox
The following NEW packages will be installed:
emacs25 emacs25-bin-common emacs25-common libaribb24-0 libboost-filesystem1.65.1 libboost-iostreams1.65.1 libcupsfilters-dev libcupsimage2-dev liblirc-client0
liblivemedia62 libmagickcore-6.q16-3-extra libmicrodns0 libnfs11 libopenmpt-modplug1 libplacebo4 libpng-dev libpng-tools libprotobuf-lite10 libsidplay2
libva-wayland2 libvlc-bin libvlccore9 vlc-bin vlc-plugin-base vlc-plugin-qt vlc-plugin-video-output
The following packages will be upgraded:
apt apt-transport-https apt-utils aptitude aptitude-common cups-common gir1.2-gconf-2.0 gir1.2-glib-2.0 gobject-introspection imagemagick imagemagick-6.q16
libbasicusageenvironment1 libdevmapper1.02.1 libebml4v5 libgirepository-1.0-1 libgroupsock8 libgutenprint2 liblircclient0 libmatroska6v5 libpython3.6-minimal
libusageenvironment3 libvlc-dev libvlc5 libvlccore-dev obex-data-server openmpi-bin openmpi-common python3.6-minimal vlc-data vlc-plugin-notify vlc-plugin-samba
31 upgraded, 26 newly installed, 10 to remove and 2514 not upgraded.
1326 not fully installed or removed.
Need to get 0 B/31.8 MB of archives.
After this operation, 46.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Extracting templates from packages: 100%
(Reading database ... 703286 files and directories currently installed.)
Removing systemd-shim (9-1bzr4ubuntu1) ...
Removing 'diversion of /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service to /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service.systemd
by systemd-shim'
dpkg-divert: error: rename involves overwriting '/usr/share/dbus-1/system-services/org.freedesktop.systemd1.service' with
different file '/usr/share/dbus-1/system-services/org.freedesktop.systemd1.service.systemd', not allowed
dpkg: error processing package systemd-shim (--remove):
installed systemd-shim package post-removal script subprocess returned error exit status 2
Errors were encountered while processing:
systemd-shim
E: Sub-process /usr/bin/dpkg returned an error code (1)
ron@ronDesktopHome:~$ :25 2019
.1) but 2:25: command not found
ron@ronDesktopHome:~$
Eu preciso usar npm
para instalar pacotes redis
e moment
no meu sistema, mas não está acontecendo, estou recebendo isso:
$ npm install redis;npm install moment
/home/ron
└─┬ [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
npm WARN enoent ENOENT: no such file or directory, open '/home/ron/package.json'
npm WARN ron No description
npm WARN ron No repository field.
npm WARN ron No README data
npm WARN ron No license field.
/home/ron
├── [email protected]
└── [email protected]
npm WARN enoent ENOENT: no such file or directory, open '/home/ron/package.json'
npm WARN ron No description
npm WARN ron No repository field.
npm WARN ron No README data
npm WARN ron No license field.
e também tentei sudo
, mas obtive o mesmo resultado... Como faço para corrigir isso?
Eu tenho uma cabeça dupla GeForce GT 520 no meu sistema e estava fazendo experiências com ela. Eu instalei o CUDA 9.1 da NVIDIA e ele disse que eu deveria reiniciar para verificar se meu driver gráfico ainda carrega.
Então, reiniciei e agora o driver gráfico não carregava mais, então desinstalei, limpei e removi automaticamente o cuda novamente e reiniciei novamente, mas ainda não consigo recuperar o X. Eu baixei e tentei instalar o driver NVIDIA, NVIDIA_Linux_x86_64-367.27.run
mas ele não quer instalar e, em vez disso, me diz para executar o sudo apt-get install nvidia-396 nvidia-modprobe nvidia-settings
que também tentei, mas ainda não consigo voltar ao meu X.
Como faço para recuperar meus gráficos?
Eu quero me livrar do nginx, pois ele me dá problemas com o apt-get, mas não consigo me livrar dele, continuo recebendo:
$ sudo apt remove nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'nginx' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up nginx-core (1.10.3-0ubuntu0.16.04.2) ...
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-05-22 06:49:55 PDT; 5ms ago
Process: 30212 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 30208 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
May 22 06:49:54 regDesktopHome nginx[30212]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
May 22 06:49:54 regDesktopHome nginx[30212]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
May 22 06:49:54 regDesktopHome nginx[30212]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
May 22 06:49:55 regDesktopHome nginx[30212]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
May 22 06:49:55 regDesktopHome nginx[30212]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use)
May 22 06:49:55 regDesktopHome nginx[30212]: nginx: [emerg] still could not bind()
May 22 06:49:55 regDesktopHome systemd[1]: nginx.service: Control process exited, code=exited status=1
May 22 06:49:55 regDesktopHome systemd[1]: Failed to start A high performance web server and a reverse proxy server.
May 22 06:49:55 regDesktopHome systemd[1]: nginx.service: Unit entered failed state.
May 22 06:49:55 regDesktopHome systemd[1]: nginx.service: Failed with result 'exit-code'.
dpkg: error processing package nginx-core (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
nginx-core
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-05-22 06:49:55 PDT; 1min 45s ago
Process: 30212 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 30208 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
$
Como posso resolver isso? Estou dentro16.04
Após a atualização de 14.04 para 16.04, o apt-get ficou de alguma forma confuso no meu xenial
sistema e não tenho certeza de como corrigi-lo. Isso é o que eu recebo (depois apt update
).
Alguém pode oferecer alguns conselhos sobre como corrigir isso?
$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libsimgearcore3.4.0v5 libsimgearscene3.4.0v5 linux-headers-4.4.0-97 linux-headers-4.4.0-97-generic linux-image-4.4.0-97-generic linux-image-extra-4.4.0-97-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up snapd (2.28.5~14.04) ...
Failed to execute operation: No such file or directory
dpkg: error processing package snapd (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
snapd
E: Sub-process /usr/bin/dpkg returned an error code (1)
Eu também tentei executar apt -f install
e obtive o seguinte:
$ sudo apt -f install
[sudo] password for ron:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libsimgearcore3.4.0v5 libsimgearscene3.4.0v5 linux-headers-4.4.0-97 linux-headers-4.4.0-97-generic linux-image-4.4.0-97-generic linux-image-extra-4.4.0-97-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up snapd (2.28.5~14.04) ...
Failed to execute operation: No such file or directory
dpkg: error processing package snapd (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
snapd
E: Sub-process /usr/bin/dpkg returned an error code (1)
onde $ sudo dpkdg --configure -a
me dá:
$ sudo dpkg --configure -a
Setting up snapd (2.28.5~14.04) ...
Failed to execute operation: No such file or directory
dpkg: error processing package snapd (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
snapd
Onde sudo apt-get --remove purge snapd
retorna:
$ sudo apt-get --remove purge snapd
[sudo] password for ron:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
cgroup-lite libsimgearcore3.4.0v5 libsimgearscene3.4.0v5 linux-generic-lts-xenial linux-headers-4.4.0-97 linux-headers-4.4.0-97-generic linux-image-4.4.0-97-generic
linux-image-extra-4.4.0-97-generic squashfs-tools
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
snapd*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 74.5 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 661915 files and directories currently installed.)
Removing snapd (2.28.5~14.04) ...
Failed to stop snapd.autoimport.service: Unit snapd.autoimport.service not loaded.
Failed to stop snapd.socket: Unit snapd.socket not loaded.
Failed to stop snapd.service: Unit snapd.service not loaded.
dpkg: error processing package snapd (--purge):
subprocess installed pre-removal script returned error exit status 5
Errors were encountered while processing:
snapd
sudo aE: Sub-process /usr/bin/dpkg returned an error code (1)
Tenho algum conflito de pacote que me impede de instalar outro software necessário: desejo instalar, tftp
mas recebo o seguinte:
ron@jpax-build07:~/tmp$ sudo apt install tftp
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:
kde-telepathy-minimal : Depends: kde-config-telepathy-accounts (>= 15.04.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
ron@jpax-build07:~/tmp$
Ok, então eu tentei:
ron@jpax-build07:~/tmp$ sudo apt -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libpthread-stubs0-dev:i386 libx11-dev:i386 libxau-dev:i386 libxcb1-dev:i386
libxdmcp-dev:i386 libxext-dev:i386 libxfixes-dev:i386 libxtst6:i386
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
kde-config-telepathy-accounts
The following NEW packages will be installed:
kde-config-telepathy-accounts
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
444 not fully installed or removed.
Need to get 0 B/137 kB of archives.
After this operation, 825 kB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 303598 files and directories currently installed.)
Preparing to unpack .../kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_amd64.deb ...
Unpacking kde-config-telepathy-accounts (4:15.12.3-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_amd64.deb (--unpack):
trying to overwrite '/usr/share/accounts/services/google-im.service', which is also in package account-plugin-google 0.12+16.04.20160126-0ubuntu1
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Errors were encountered while processing:
/var/cache/apt/archives/kde-config-telepathy-accounts_4%3a15.12.3-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
ron@jpax-build07:~/tmp$
Como faço para me livrar dessa bagunça?
ATUALIZAÇÃO1
Quando o faço $ sudo apt remove kde-config-telepathy-accounts
, chego Package 'kde-config-telepathy-accounts' is not installed, so not removed
onde $ sudo apt remove account-plugin-google
me dá dependências não atendidas das kde-telepathy-minimal
quais depende kde-config-telepathy-accounts
- isso não faz sentido!
Estou executando o Ubuntu 16.04, que não possui um kdesvn
pacote. Eu queria compilar a kdesvn
partir de fontes, cmake
tudo corre bem depois de instalar todas as dependências, mas a compilação trava em:
[ 78%] Building CXX object src/svnfrontend/CMakeFiles/svnfrontend.dir/maintreewidget.cpp.o
/home/ron/src/kdesvn/src/svnfrontend/maintreewidget.cpp: In member function ‘void MainTreeWidget::enableActions()’:
/home/ron/src/kdesvn/src/svnfrontend/maintreewidget.cpp:826:46: error: ‘authorizeAction’ is not a member of ‘KAuthorized’
enableAction(QStringLiteral("openwith"), KAuthorized::authorizeAction("openwith") && single && !single_dir);
^
src/svnfrontend/CMakeFiles/svnfrontend.dir/build.make:850: recipe for target 'src/svnfrontend/CMakeFiles/svnfrontend.dir/maintreewidget.cpp.o' failed
make[2]: *** [src/svnfrontend/CMakeFiles/svnfrontend.dir/maintreewidget.cpp.o] Error 1
CMakeFiles/Makefile2:764: recipe for target 'src/svnfrontend/CMakeFiles/svnfrontend.dir/all' failed
make[1]: *** [src/svnfrontend/CMakeFiles/svnfrontend.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Por que isso acontece e como posso corrigi-lo?
Eu verifiquei que libkf5config-dev está instalado, ele contém KAuthorized
: https://packages.ubuntu.com/xenial/amd64/libkf5config-dev/filelist
De repente, continuo recebendo o snap Aw! erro no Chrome e não consigo me livrar dele, tentei rm -rf .config/google-chrome/
mas não ajudou... alguma sugestão?
estou a usar
$ google-chrome --version Google Chrome 39.0.2171.71
e lançá-lo a partir do shell me dá isso:
$ google-chrome&
[1] 12762
ron@regDesktopHome:~$ [9:9:0531/192000:ERROR:nss_util.cc(207)] Error initializing NSS without a persistent database: NSS error code: -8023
[9:9:0531/192000:FATAL:nss_util.cc(209)] nss_error=-8023, os_error=0
[11:11:0531/192000:ERROR:nss_util.cc(207)] Error initializing NSS without a persistent database: NSS error code: -8023
[11:11:0531/192000:FATAL:nss_util.cc(209)] nss_error=-8023, os_error=0
[13:13:0531/192003:ERROR:nss_util.cc(207)] Error initializing NSS without a persistent database: NSS error code: -8023
[13:13:0531/192003:FATAL:nss_util.cc(209)] nss_error=-8023, os_error=0
[15:15:0531/192006:ERROR:nss_util.cc(207)] Error initializing NSS without a persistent database: NSS error code: -8023
[15:15:0531/192006:FATAL:nss_util.cc(209)] nss_error=-8023, os_error=0
[17:17:0531/192009:ERROR:nss_util.cc(207)] Error initializing NSS without a persistent database: NSS error code: -8023
[17:17:0531/192009:FATAL:nss_util.cc(209)] nss_error=-8023, os_error=0
Preciso de um script que possa ser executado como um usuário que modifique o endereço MAC de eth0
. Eu criei o seguinte script:
#!/bin/bash
/etc/init.d/networking stop
ifconfig eth0 hw ether 00:50:56:98:00:19
/etc/init.d/networking start
Eu defini a permissão setuid e atribuí-a ao root:
-rwsr-xr-x 1 root root 110 May 24 14:22 ChangeMac.sh
mas ainda assim me daria a seguinte saída quando eu a executasse como usuário:
$ ./ChangeMac.sh
stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.100" (uid=1000 pid=6746 comm="stop networking ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
SIOCSIFHWADDR: Operation not permitted
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.103" (uid=1000 pid=6753 comm="start networking ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
Por que é isso? Como posso fazer com que um usuário possa invocá-lo, mas seja executado como root?