Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You can change the permissions as root and then change them back as root, but I know of no way to change them and put an automatic expiration date on the change.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,679
Rep:
I don't really understand the question. For most root-owned configuration files, let's use /etc/fstab as an example, any user can just open them with gedit and see the contents but not write to the file.
So, exactly what is it you need to do here and why can't the files be set to world readable?
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 978
Original Poster
Rep:
If I'm logged in as root and I '[kbs@localhost ~]$ sudo gedit',it will open any file as root with writable privileges.
I was looking to use the simplest GUI method but VIM will do.
Thanks for all of the replies!
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,679
Rep:
Now I'm even more confused. Why are you using sudo when you're logged in as root? If you're not logged in as root just typing "gedit filename" will open a root file read only.
some Xapps display plain text files in a scrollable window with an OK button at the end.
xmessage can do it, and there was another one whose name eludes me atm...
you could do it with yad or xdialog.
geany has a read-only option.
all that assuming that you have write permissions on that file, otherwise it's automatically read-only (if even that).
but honestly i think you should revise your concept of users & privileges, something is amiss here...
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 978
Original Poster
Rep:
I was using Mageia 1 ;because it was holding up better than 4, and when I tried to open gedit as root I got an error message that I did not commit to memory. I'm now booted to mageia 4 and don't have the issue. Using sudo as root opened up gedit but not without it.
I'm getting a crazy amount of port scans, you name it ,ssh ,telnet;etcetera, so I wanted to experiement with Iptables with less risk and a minimal amount of effort. I initially learn more from GUI apps and then like to use bash after I get aquainted with things.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.