sudo issue

Ralf Mardorf silver.bullet at zoho.com
Mon Aug 1 10:25:53 UTC 2016


Hi,

is there a way to set up sudo, that it is able to copy everything, when
running a line such as

  sudo cp -rp /path/.foo /to/another/path/

?

My sudo is unable to do this:

[weremouse at moonstudio ~]$ sudo ls -Ald /mnt/archlinux/.chuser/.home/.jwm*; echo $?
[sudo] password for weremouse: 
ls: cannot access '/mnt/archlinux/.chuser/.home/.jwm*': No such file or directory
2
[weremouse at moonstudio ~]$ sudo cp -rp /mnt/archlinux/.chuser/.home/.jwm* /tmp/; echo $?
cp: cannot stat '/mnt/archlinux/.chuser/.home/.jwm*': No such file or directory
1
[weremouse at moonstudio ~]$ sudo -i
[root at moonstudio ~]# cp -rp /mnt/archlinux/.chuser/.home/.jwm* /tmp/; echo $? 
0
[root at moonstudio ~]# logout
[weremouse at moonstudio ~]$ su -c "ls -Ald /mnt/archlinux/.chuser/.home/.jwm*; echo $?"
Password: 
lrwxrwxrwx 1 1001 1001 24 May 25  2015 /mnt/archlinux/.chuser/.home/.jwmrc -> /home/rocketmouse/.jwmrc
0
[weremouse at moonstudio ~]$ sudo echo $USER; id -nu; id -u
weremouse
weremouse
1000
[weremouse at moonstudio ~]$ su -c "echo $USER; id -nu; id -u"
Password: 
weremouse
root
0
[weremouse at moonstudio ~]$ sudo -i
[root at moonstudio ~]# echo $USER; id -nu; id -u
root
root
0
[root at moonstudio ~]# dpkg -l sudo* login | grep ii
ii  login          1:4.2-3.1ubuntu5  amd64        system login tools
ii  sudo           1.8.16-0ubuntu1.1 amd64        Provide limited super user privileges to specific users
[root at moonstudio ~]# egrep -v "^#|^$" /etc/sudoers
Defaults	env_reset
Defaults	mail_badpass
Defaults	secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
root	ALL=(ALL:ALL) ALL
%admin ALL=(ALL) ALL
%sudo	ALL=(ALL:ALL) ALL

Regards,
Ralf





More information about the ubuntu-users mailing list