LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 10-17-2012, 07:59 PM   #1
MaLijaa
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Rep: Reputation: Disabled
Can some1 help me ?!


I alredy posted, and some1 deleted my psot, dunno why. I am newbie in linux as i wrote in last post, and i am not supposted to know everything from 1st moment. But nvm that...

Ok, let me explain u my problem. I need this linux centos 6.3 for my uni . I tryed command "sudo vi .bashrc"

When i write a line there it write me to restart terminal . When i restart it, i try to log in "su -" but i cant ...

so, does some1 know how to repair it or i should reinstall whole centos ?

Here is a msg when i write "su -" ... after "su -" ask me for "passwd" i write a passwd and terminal write me a error "-bash: /root/.bashrc: line 13: syntax error: unexpected end of file
-bash-4.1#"


Some1 can help ?
 
Old 10-17-2012, 08:42 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,367
Blog Entries: 16

Rep: Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147Reputation: 3147
First, please use standard spelling and not text speak. Trying to write in standard English (I don't mean perfect: I mean writing "someone," not "some1" and trying to use normal grammar) makes it easier for everyone.

You don't tell us much, but I suspect that it's because you can't as yet, but I'll take a shot:

My best guess is that you somehow managed to save a corrupted or incomplete .bashrc file; as a result the bash terminal won't run properly. It might even be root's .bashrc that got hosed, which could account for the failure of the su - command.

Is there a GUI installed on the machine? In that case, you might be able to use your graphical file manager and text editor to look into this further without having to open a terminal.

When you edit a file with vi, vi normally saves the unmodified file with a tilde extension, like this: .bashrc~.

Look for that file, then rename it and put it in place of the corrupted file (I would recommend renaming the corrupted file, rather than just overwriting it).

If the .bashrc that is corrupted is indeed the one that belongs to root, you may have to boot to a Live CD of something (Knoppix is good for this) and investigate this further in that manner, as user will not have permission to access root's files and su does not appear to be working (if I remember correctly, CentOS does not automatically set up the sudoers file the way Ubuntu does).

Again, this is a shot in the dark, but perhaps it will give you a start.

Last edited by frankbell; 10-17-2012 at 08:45 PM.
 
Old 10-17-2012, 09:02 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,107

Rep: Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478
guessing that that thread name was like this one
it is a big " no-no" to use something like
"Can some1 help me ?!"

that will lead to it being removed
or moved to the "general" section

you might want to read the posting guide
-- see at the top of this page the link called " tutorials"
-- there is a section for this forum
"How To Ask a Question "
http://www.linuxquestions.org/linux/...Ask_a_Question

first cent dose not use "sudo"
"sudo" is NOT set up by default
so unless YOU configure it you can not use it
"sudo" if mis-configured CAN be and IS a VERY major security hole - so for that reason it is not used most of the time
( there are GOOD reasons to use it so it can be set up )

use " su " and the different command " su -" ( with a space then a dash )

also Vi is not installed by default "nano" is


for VI you might want to go to the vi web site and PRINT the "cheat sheet"

http://www.tuxfiles.org/linuxhelp/vimcheat.html
http://www.eec.com/business/vi.html
http://vim.wikia.com/wiki/Vim_Tips_Wiki

so assuming you DID set up "sudo" and did use vi to edit the NORMAL user .bashrc and royally messed it up
Quote:
bash: /root/.bashrc:
you edited the root file -- not good
there is NOTHING ( except a few theme settings ) that need to be touched in that folder
-- do not edit files in /root there is almost nothing there that needs editing

put this in it
Code:
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi
and ONLY that

there is almost NEVER any reason to login to cent AS root using the GUI
i only found one -- setting up a new install on the second reboot - on ONLY then
after that there is NO reason to login into Gnome AS ROOT --- do not do it .


if you can not become root you might have to boot into "single user mode"
during the 3 sec countdown at boot
hit enter
hit "e" for edit
use the down arrow to navigate to the current boot line ( down arrow one time) and add a space and a 1 to the end of the grub kernel boot line and hit enter then "b" for boot
READ the onscreen instructions
that will be a TEXT only user less boot into root
-- text ONLY --

and next time if you need to make changes use /etc/bashrc -- that is the SYSTEM wide config file
but pay attention to the files WARNING
Quote:
# System wide functions and aliases
# Environment stuff goes in /etc/profile

# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.

Last edited by John VV; 10-17-2012 at 09:16 PM.
 
1 members found this post helpful.
Old 10-18-2012, 05:22 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
I alredy posted, and some1 deleted my psot,
The other thread is probably this one: http://www.linuxquestions.org/questi...lp-4175432651/

And you can find it using 'my threads' under the 'my lq' heading at the right hand side of the page
 
1 members found this post helpful.
Old 10-18-2012, 07:20 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839
Quote:
Originally Posted by John VV View Post
guessing that that thread name was like this one
it is a big " no-no" to use something like
"Can some1 help me ?!"

that will lead to it being removed
or moved to the "general" section
Just to clarify that: No thread will be removed because of a bad title and no thread will be moved to a different forum because of a bad title.
 
1 members found this post helpful.
  


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
Can some1 pleease help me with this code?? kyle7042 Linux - Newbie 10 05-04-2012 05:03 PM
can some1 help me get my wireless card to work on fedora core 5? pyrosk8er368 Linux - General 1 02-12-2007 05:07 AM
some1 able to run alsa on 2.4.29 kernel? ygloo VectorLinux 5 12-09-2006 04:05 AM
Can some1 tell mewhat does this mean? woho Linux - General 8 01-30-2004 05:09 PM
I'm hopeless can some1 Help me SlackN00b Linux - Newbie 5 12-26-2003 07:47 AM

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

All times are GMT -5. The time now is 09:05 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