PDA

View Full Version : Permission denied.....



landolini
6th June 2008, 02:31 PM
I cannot read the file below ...and change permission because I ' m told I 'm not
the owner ....( I've tried both with chmod and trought file > property > permission...)
How can I do ?
Many thanks


[root@localhost lando]# cp /mnt/smb/bookmarks-2008-05-03.html /home/lando
cp: cannot open `/mnt/smb/bookmarks-2008-05-03.html' for reading: Permission denied



[root@localhost lando]# ls -l /mnt/smb


-rw-r--r-- 1 1000 1000 38718 2007-11-12 16:45 AMULEFirewall.html
-rw-r--r-- 1 1000 1000 1538 2008-01-07 12:15 asm1.txt
-rw-r----- 1 1000 1000 361656 2008-05-03 03:39 bookmarks-2008-05-03.html

dmbyer
6th June 2008, 03:01 PM
Log in as root using su -
Then can you post the output of:


whoami
cat /etc/passwd | grep lando
cat /etc/passwd | grep root
cat /etc/passwd | grep 1000
ls -l /mnt/smb/
chmod a+r /mnt/smb/bookmarks-2008-05-03.html
ls -l /mnt/smb/

landolini
6th June 2008, 05:40 PM
Log in as root using su -
Then can you post the output of:


whoami
cat /etc/passwd | grep lando
cat /etc/passwd | grep root
cat /etc/passwd | grep 1000
ls -l /mnt/smb/
chmod a+r /mnt/smb/bookmarks-2008-05-03.html
ls -l /mnt/smb/




[root@localhost lando]# whoami
root
[root@localhost lando]# cat /etc/passwd | grep lando
lando:x:500:500:lando:/home/lando:/bin/bash
[root@localhost lando]# cat /etc/passwd | grep root
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
[root@localhost lando]# cat /etc/passwd | grep 1000
[root@localhost lando]# ls -l /mnt/smb/
total 56240

drwxr-xr-x 3 1000 1000 0 2007-11-13 08:50 amule_configurazione.asp_files
-rw-r--r-- 1 1000 1000 27316 2007-11-13 08:50 amule_configurazione.asp.html
drwxr-xr-x 2 1000 1000 0 2007-11-12 16:45 AMULEFirewall_files
-rw-r--r-- 1 1000 1000 38718 2007-11-12 16:45 AMULEFirewall.html
-rw-r--r-- 1 1000 1000 1538 2008-01-07 12:15 asm1.txt
-rw-r--r-- 1 1000 1000 361656 2008-05-03 03:39 bookmarks-2008-05-03.html

-rwxr--r-- 1 1000 1000 4471 2008-03-12 09:21 Fadera.java
drwxr-xr-x 2 1000 1000 0 2007-12-20 08:21 Guida_rapida_file_ISO_files
-rw-r--r-- 1 1000 1000 11330 2007-12-20 08:21 Guida_rapida_file_ISO.htm
-rwxr--r-- 1 1000 1000 18501 2008-01-19 05:42 index.html
drwxr-xr-x 2 1000 1000 0 2008-01-21 11:47 Linux_samba_wkg_files
-rw-r--r-- 1 1000 1000 43524 2008-01-21 11:47 Linux_samba_wkg.html
drwxr-xr-x 6 1000 1000 0 2007-11-13 08:55 Listaserver.php_files
-rw-r--r-- 1 1000 1000 130277 2007-11-13 08:55 Listaserver.php.html
drwxr-xr-x 3 1000 1000 0 2007-11-14 05:11 nodes.dat - nodes for emule kademlia net_files
-rw-r--r-- 1 1000 1000 5249 2007-11-14 05:11 nodes.dat - nodes for emule kademlia net.html
drwxr-xr-x 5 1000 1000 0 2007-11-14 12:24 ServerAmule.php_files
-rw-r--r-- 1 1000 1000 131880 2007-11-14 12:24 ServerAmule.php.html
-rw-r--r-- 1 1000 1000 705 2007-11-13 11:38 server.met
-rwxrw-r-- 1 nfsnobody 65534 55151822 2008-04-10 04:02 VMwareTools-6.0.3-80004.tar.gz
-rwxrw-r-- 1 nfsnobody 65534 1624 2008-04-11 16:36 xorg.confcentos
[root@localhost lando]# chmod a+r /mnt/smb/bookmarks-2008-05-03.html
chmod: changing permissions of `/mnt/smb/bookmarks-2008-05-03.html': Permission denied



Having added "r" in the Ubuntu system owner of this file (samba connection)...now I can work on it !
-rw-r--r-- 1 1000 1000 361656 2008-05-03 03:39 bookmarks-2008-05-03.html

Thanks

dmbyer
6th June 2008, 09:39 PM
Right, forgot about Samba authenticating users.

For everyone else's information, the /mnt/smb folder is a network folder on another computer. He was trying to authenticate on the remote server using the root account, which is disallowed by default. When he set the read permission for everyone, he was then able to at least read the file.

For your information landolini, if you logged in to your local computer as user or group ID 1000 (which you do not have, and would need to set up), you would be able to access this file without being root. Otherwise you will need to enable remote root authentication for the samba server.