LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Permissions issue, i dont have them in gnome, but command line ok (https://www.linuxquestions.org/questions/linux-newbie-8/permissions-issue-i-dont-have-them-in-gnome-but-command-line-ok-4175494522/)

postcd 02-11-2014 04:46 AM

Permissions issue, i dont have them in gnome, but command line ok
 
Hi, i have

"sshfs" folder

Quote:

# stat sshfs
File: `sshfs'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 15h/21d Inode: 1 Links: 1
Access: (0775/drwxrwxr-x) Uid: ( 1000/ amnesia) Gid: ( 0/ root)
Access: 2014-02-11 10:40:01.000000000 +0000
Modify: 2014-02-11 10:39:44.000000000 +0000
Change: 2014-02-11 10:39:44.000000000 +0000
and i create file called "d" (touch d)

-rw------- 1 amnesia root 0 Feb 11 10:39 d

then from gnome interface, i try to write some text into the file, but it tells me i dont have rights. my username is amnesia

but when i do:
echo "test" > d

from command line, data is written, whoami: amnesia

what i want to do is to be able to write into the newly created file in gnome interface, without everytime changing some permissions..

do i need to anyhow chown or chmod the sshfs folder, how please?

fuorviato 02-11-2014 06:11 AM

Login as amnesia and check what groups is your account assigned to.

Quote:

fuorviatos@fuorviatos:~$ groups
fuorviatos adm cdrom sudo dip plugdev lpadmin sambashare jupiter

postcd 02-11-2014 06:21 AM

Quote:

Originally Posted by fuorviato (Post 5115462)
Login as amnesia and check what groups is your account assigned to.

thx, it is like this...:
Code:

amnesia@amnesia:~$ whoami
amnesia
amnesia@amnesia:~$ groups
amnesia lp dialout cdrom floppy audio video plugdev lpadmin fuse scanner netdev vboxsf


fuorviato 02-11-2014 06:56 AM

It can be seen, you are issuing command in shell as root, so go figure why write permissions are allowed.
Type:
Quote:

ls -l sshfs
and paste its output here.

postcd 02-11-2014 08:22 AM

Quote:

Originally Posted by fuorviato (Post 5115475)
It can be seen, you are issuing command in shell as root, so go figure why write permissions are allowed.
Type: and paste its output here.

thx, these are my private files so i obfuscate:

Quote:

amnesia@amnesia:~$ ls -l sshfs
total 2740
-rwxr-xr-x 1 amnesia root 319 Feb 11 10:19 ***.***
drwxrwxr-x 1 amnesia root 4096 Feb 11 14:14 browser***
-rw------- 1 amnesia root 5 Feb 11 10:42 d
drwxrwxr-x 1 amnesia root 4096 Feb 10 23:10 docs***
drwxrwxr-x 1 amnesia root 4096 Feb 8 14:17 docs***
-rw-r--r-- 1 amnesia root 93222 Feb 10 17:33 dropbox_1.6.0_i386.deb
drwxrwxr-x 1 amnesia root 4096 Feb 11 13:39 Hud***
drwxrwxr-x 1 amnesia root 12288 Feb 10 20:26 Obr***
-rwxr-xr-x 1 amnesia root 2671271 Feb 7 2012 truecrypt-7.1a-setup-x86
...

fuorviato 02-11-2014 08:48 AM

Go one level up from the sshfs directory and issue as root
Quote:

chown -R amnesia:amnesia sshfs/
.
This will make you owner of the directory, including sub-directories.
After this try to create there some files using GNOME.
Keep in mind that you won't open any file from the d directory as it has no execute permission.
If you wanna achieve that use chmod.

postcd 02-11-2014 09:06 AM

thanks, i want to try, it i just have question, that folder is an mounted folder from remote server, it is folder of the "root" of that server, so should i really try changing amnesia:amnesia -R ?

im running that command now, its around 10 minutes, not ready yet, its like 400 files i hope :/

postcd 02-11-2014 09:33 AM

update: 703 files, 65 directories, 450MB of data , took around 15 minutes..

BUT NOT SOLVED

Editting&saving of the "d" file now works, but newly created file keeps old permissions (amnesia:root)

Quote:

amnesia@amnesia:~/sshfs$ ls -l kkk
-rw------- 1 amnesia root 0 Feb 11 15:27 kkk
Quote:

amnesia@amnesia:~/sshfs$ ls -l
...
-rw-r--r-- 1 amnesia amnesia 93222 Feb 10 17:33 dropbox_1.6.0_i386.deb
drwxrwxr-x 1 amnesia amnesia 4096 Feb 11 13:39 Hud***
-rw------- 1 amnesia root 0 Feb 11 15:27 kkk
drwxrwxr-x 1 amnesia amnesia 12288 Feb 10 20:26 Obr***
...

fuorviato 02-11-2014 09:34 AM

Quote:

Originally Posted by postcd (Post 5115566)
thanks, i want to try, it i just have question, that folder is an mounted folder from remote server, it is folder of the "root" of that server, so should i really try changing amnesia:amnesia -R ?

Well, seeing that it's a network share, I'd rather not change that as it would allow anyone knowing your username password to access the files on the server.
Instead, do some singular chmoding on files that lack execute and read permissions.

Quote:

im running that command now, its around 10 minutes, not ready yet, its like 400 files i hope :/
The -R parameter affect everything under the main directory - that's the reason.
You can easily revert it, by
Quote:

chown -R amnesia:root sshfs/
.

postcd 02-11-2014 09:44 AM

this is new file created permissions

http://i.snag.gy/t0N5j.jpg

the permissions from terminal looks like:
-rw------- 1 amnesia root 0 Feb 11 15:27 new


---
This issue looks related (only its for Mac):
https://groups.google.com/forum/#!to...se/kQrb4cVu3jQ
(SSHFS and write permissions ?)

So i assume i cant fix these permissions to work properly, and its sshfs issue?

fuorviato 02-11-2014 10:09 AM

Quote:

Originally Posted by postcd (Post 5115600)
this is new file created permissions

http://i.snag.gy/t0N5j.jpg

the permissions from terminal looks like:
-rw------- 1 amnesia root 0 Feb 11 15:27 new

They look correct; The owner of each new file is amnesia and it gets read and write permissions. If different user is to operate on the files, he will need to be in "root" group. Isn't it fair enough for you?

postcd 02-11-2014 10:30 AM

Yes, only that i cant write into newly created file when working in GNOME interface.
-rw------- 1 amnesia root 0 Feb 11 15:27 new

fuorviato 02-11-2014 12:01 PM

You're right. What did you use to mount the share?

taikedz 02-12-2014 03:51 AM

I might be a bit off here, but I'd say it sounds strange that your user's group is "root" and it does not have the "users" group in its group list...

If you create a file elsewhere via GNOME what are the permissions? (I'd like to see who GNOME is running as, and in what group). Are you logging into GNOME as "amnesia" as well?

When you start the terminal, did you `su` to being a different user?

And yes, what command did you use to mount that share?

(Also, what are you doing mounting the folder of your other server's root user folder?)


All times are GMT -5. The time now is 06:56 PM.