LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 04-18-2012, 06:48 PM   #1
xtropx
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
VIM, NANO, Gedit, CAT display VISUDO as garbage


VIM, NANO, Gedit, CAT are displaying the visudo file on CentOS 6.2 as a bunch of garbage. Gedit gives me an error about UTF-8 encoding. This happens over SSH too. Tried as root (su) and regular user. What is going on here?
 
Old 04-19-2012, 12:14 AM   #2
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
Have you tried setting your locale to an UTF setting

in debian its

Code:
sudo dpkg-reconfigure locales
 
Old 04-19-2012, 12:39 PM   #3
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,250

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Check your locale with the "locale" command. So my output starts with
LANG=en_GB.utf8
There's a file /etc/sysconfig/i18n that sets the locale for the console: mine has
LANG="en_US.UTF-8"
which is presumably a default, and the installer only set the language for X. The only idea I have for setting the locale in X is to add an "export LANG=" to ~/.bashrc but I offer no promises. As for the difference of UTF-8 and utf8, that's a mystery to me.

Last edited by DavidMcCann; 04-19-2012 at 12:41 PM.
 
Old 04-19-2012, 01:21 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,712

Rep: Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168
Quote:
Originally Posted by xtropx View Post
VIM, NANO, Gedit, CAT are displaying the visudo file on CentOS 6.2 as a bunch of garbage. Gedit gives me an error about UTF-8 encoding. This happens over SSH too. Tried as root (su) and regular user. What is going on here?
Exactly what SHOULD be going on. Visudo is a binary program, not a text file. All you're going to see is 'garbage' (that is, compiled hex code). Try editing any regular text-type file.
 
Old 04-19-2012, 07:10 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,440

Rep: Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791
Dagnabbit! I should have seen that too; looked at this qn a few times in passing and didn't click grrrr
<drinks coffee>
 
Old 04-20-2012, 12:20 PM   #6
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,250

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
We all jumped to the conclusion that the OP meant sudoers! It takes me back to school-days: "Answer the question you are asked, not the one you expected."
 
Old 04-29-2012, 11:48 AM   #7
xtropx
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Exactly what SHOULD be going on. Visudo is a binary program, not a text file. All you're going to see is 'garbage' (that is, compiled hex code). Try editing any regular text-type file.
Ok, thank you. What is the proper procedure then to give a user sudo capabilities on Debian? I was under the impression you just added the user to that file, but that doesn't make much sense if you can't edit it with anything...
 
Old 04-30-2012, 01:18 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,712

Rep: Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168
Quote:
Originally Posted by xtropx View Post
Ok, thank you. What is the proper procedure then to give a user sudo capabilities on Debian? I was under the impression you just added the user to that file, but that doesn't make much sense if you can't edit it with anything...
Very first hit for "how to give a user sudo rights in linux":
http://www.linuxhomenetworking.com/w...Users_and_Sudo

You edit the sudoers file, and for that, you have to use a specific tool, called visudo.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sending a program to my 2nd display e.g. gedit Frustin Linux - Desktop 1 03-19-2012 12:19 PM
CentOS 5.5 x86_64 - Dom0 console display colorful garbage scramble awong_xen Linux - Virtualization and Cloud 2 01-04-2011 11:48 AM
problem for display chinese in gedit zauberliu Linux - Software 3 02-08-2010 04:45 AM
(gedit:6540): Gtk-WARNING **: cannot open display: :0 jax8 Programming 3 05-07-2009 07:57 AM
Why does the only resolution I need, only display garbage? Wayne_Zombie Linux - Hardware 5 05-19-2004 10:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration