LinuxQuestions.org
Review your favorite Linux distribution.
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, 07: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, 01:14 AM   #2
aus9
LQ Guru
 
Registered: Oct 2003
Distribution: MX
Posts: 5,132

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, 01:39 PM   #3
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,264

Rep: Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246
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 01:41 PM.
 
Old 04-19-2012, 02:21 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,326

Rep: Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881
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, 08:10 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
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, 01:20 PM   #6
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,264

Rep: Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246
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, 12:48 PM   #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, 02:18 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,326

Rep: Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881
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 01:19 PM
CentOS 5.5 x86_64 - Dom0 console display colorful garbage scramble awong_xen Linux - Virtualization and Cloud 2 01-04-2011 12:48 PM
problem for display chinese in gedit zauberliu Linux - Software 3 02-08-2010 05:45 AM
(gedit:6540): Gtk-WARNING **: cannot open display: :0 jax8 Programming 3 05-07-2009 08:57 AM
Why does the only resolution I need, only display garbage? Wayne_Zombie Linux - Hardware 5 05-19-2004 11:58 AM


All times are GMT -5. The time now is 04:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration