-1

Ubuntu 14.04

I can not use wget and I'm using the root account:

wget whatever
/usr/bin/wget: Permission denied

ls -ld /usr/bin/*

-rwxr-xr-x 1 root root       23632 Feb 11  2015 /usr/bin/watch
-rwxr-xr-x 1 root root       39648 Mar 11  2016 /usr/bin/wc
-rwxr-xr-x 1 root root       75944 Apr 28  2014 /usr/bin/webapp-container
-rwxr-xr-x 1 root root      231592 Apr 28  2014 /usr/bin/webbrowser-app
-rwxr-xr-x 1 root root         286 Dec  8 00:37 /usr/bin/wftopfa
---------- 1 root root      407696 Jun 14  2016 /usr/bin/wget
-rwxr-xr-x 1 root root       48112 Sep 24  2014 /usr/bin/whatis
-rwxr-xr-x 1 root root       15128 Nov 24 06:25 /usr/bin/whereis
lrwxrwxrwx 1 root root          10 Nov 26  2015 /usr/bin/which -> /bin/which
-rwxr-xr-x 1 root root       51968 Mar 11  2016 /usr/bin/who
-rwxr-xr-x 1 root root       27200 Mar 11  2016 /usr/bin/whoami
-rwxr-xr-x 1 root root       53048 Aug 25 01:43 /usr/bin/whoopsie

I can not chmod it:

chmod 755 /usr/bin/wget
chmod: changing permissions of ‘/usr/bin/wget’: Operation not permitted

What should I do? Thanks!

1 Answer 1

0

First do sudo chattr -i /usr/bin/wget and then sudo chmod 755 /usr/bin/wget.

The -i flag sets the file as immutable, giving it the following characheristics:

  • A file with the i attribute cannot be modified.

  • It cannot be deleted or renamed, no link can be created to this file and no data can be written to the file.

  • When set, prevents, even the superuser, from erasing or changing the contents of the file.

3
  • same output still: sudo chmod 755 /usr/bin/wget chmod: changing permissions of ‘/usr/bin/wget’: Operation not permitted
    – leoce
    Feb 2, 2017 at 9:37
  • what does sudo lsattr /usr/bin/wget show? what does sudo ls -lah /usr show?
    – 13dimitar
    Feb 2, 2017 at 9:38
  • sudo lsattr /usr/bin/wget ----i--------e-- /usr/bin/wget sudo ls -lah /usr total 156K drwxr-xr-x 10 root root 4.0K Apr 17 2014 . drwxr-xr-x 23 root root 4.0K Feb 3 00:13 .. drwxr-xr-x 4 root root 68K Feb 3 01:21 bin drwxr-xr-x 2 root root 4.0K Dec 6 18:30 games drwxr-xr-x 39 root root 20K Dec 6 18:28 include drwxr-xr-x 159 root root 20K Feb 3 00:51 lib
    – leoce
    Feb 2, 2017 at 9:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .