l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
December 2: Social gathering
Next Installfest:
TBD
Latest News:
Nov. 18: Club officer elections
Page last updated:
2003 Feb 12 12:25

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] baby steps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] baby steps



On Wed, Feb 12, 2003 at 08:39:48AM -0800, Jim wrote:
> I don't have access to certain files even when trying to access these files 
> using shell konsole.  I su to root but still have the error message "bash: 
> /etc/samba/smb.conf: Permission denied".

You can end up with a "Permission denied" on a file that's perfectly
readable _if_ you're trying to execute it.

For example, say you had the file "foobar.txt".  If you did this:

  ./foobar.txt

You' d get:

  ./foobar.txt: Permission denied.


In your case, you might be typing simply:

  /etc/samba/smb.conf

at the command line.  Rather than using that file's path as an argument
to some other program (e.g., an editor like 'vi').



> The only way that I can modify these files is by logging out then logging
> back as user root.

Well, if it IS indeed a permissions problem (with regards to reading or
writing the file, and not any inadvertent attempt to execute it), then
yes, perhaps 'su'ing vs. "logging-out-and-back-in-as-root" is the issue.

One of the most useful things to include when reporting an issue like this
are the actual permissions of the file itself! :^)

Run this:

  ls -l /etc/samba/smb.conf

and then cut'n'paste it into your e-mail so we can all see. :^)

My "smb.conf" file looks like so:

  -rw-r--r--    1 root     root         4916 Nov 25 13:51 /etc/samba/smb.conf

Seems reasonable.  If I 'su' to root and then run "vi /etc/samba/smb.conf",
the file comes up just fine.



Now, thinking about it again, if there WERE a permission problem with
being able to read it, "vi" would be the one complaining, not "bash",
so I'm beginning to think it MUST be that you forgot to specify what
command you wanted to edit 'smb.conf' with. :^)


> Can't I somehow change my permission to access and /or modify these files?
> I would like to use the GUI to edit these files but I can't even do this
> if I don't have the permission to do so.

As with running "vi" on the file, using a GUI should work just fine,
too.  For example, under KDE, you could do something like:

  kate /etc/samba/smb.conf &

("kate" is the advanced text editor in KDE; the "&" tells your shell to
run the program 'in the background';  in other words, the Kate window will
appear, and Kate will load the file... in the meantime, your shell will
return to prompting you for another command.  It won't be 'stuck' there,
waiting for you to quit Kate.)

You could, of course, also just load the editor from the GUI.
(In KDE, click the "K" icon in the 'kicker' panel at the bottom.
In GNOME, click the "G"-shaped foot icon in the Gnome panel at the bottom.
Then dig around until you find an editor you'd like to use.  Load it up,
and then do your standard "File" -> "Open" routine.)


Note that if you run that command as your normal user, assuming the file
is readable by you (like my "smb.conf" is above... see the third "r" in
the permissions column at the far left of the "ls -l" output), you'll
be able to LOAD it.  Kate may even let you make changes in the copy it has
in memory.  You just won't be able to save back over the file.
(With the permissions show above, root and only root will be able to save
over that file!)


You'll want to try "su"ing to root in a shell, and THEN run "kate...".
(Now, there may end up being issues there about root not having permission
to display an X-Window program on your screen while you're logged in as
your normal user.  We'll cross that bridge when we decide to come to it,
though...)


> Could someone enlighten me?

Hopefully, I have already. ;^)


-- 
bill@newbreedsoftware.com                    Was I useful?  Rate this message!
http://newbreedsoftware.com/bill  http://svcs.affero.net/rm.php?r=billkendrick
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.