Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> New to linux, SSH help
DaveUK
post Nov 15 2006, 07:30 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 15-November 06
Member No.: 7,791



First post on here although it may not be my last with the current situation I've found my self in.

I work for a small company and we run a Linux box with samba and a basic intranet website used for taking bookings (over the phone).

Now as i say we are very small and don't have a i.t. department or any i.t. staff as such, we was lucky that we had someone working for us previously who setup the Linux box and who looked after it. Now he has left i seem to have taken over his role.

I am very new to Linux but i am a quick learner and would like to get into Linux.

OK I've given my background which i hope will help you understand my situation and hopefully stop you thinking "who gave that idiot root access?" I'll get onto my problem.

Since i took over I've been having a clear out of old files we never use (documents etc) some of which we couldn't delete via the samba windows shares from my windows machine so i had to log into the box via SSH and remove the files using a command like "rm -rf oldfile.doc" which was all fine.

Until i found another file which we couldn't delete (most of these files are from previous employee's which I'm guessing i cant delete because the files are owned by another user) using the above command i managed to delete the file just fine but did notice the command line changed. It didn't change when i did the command it must of been like that when i logged in but its not as it normally would be.

Normally the command line would be something like:
root@localhost ~# <- when in my home space
root@localhost /var/www/htdocs# <- when in the web space folder

But now it just shows:
-bash-3.00#

The shell still works as it should but this is very annoying because if i alt tab to another application and then go back to the shell i find i will of forgot what directory i am in, I've tried restarting SSHD and restarting the server.

To my knowledge no one else has changed anything and i haven't changed anything other than deleting a few documents.

Please can anyone help me get my normal command prompt back as default?!?

Server specs:
CentOS 4.4
2.66Ghz Celeron
1Gb Ram
2x 160Gb HD RAID setup.

I'm Connecting via SSH using PUTTY.

UPDATE:

A friend suggested i might not be logged on as root and suggested i typed "su root" to switch user, even though i was 10000% sure i was logged on as root i thought worth a try! would you believe it my normal command prompt came back!

If i disconnect from ssh and reconnect it still takes me to the dodgy command prompt and i have to SU.

Thanks in advanced and sorry for the essay!

- Dave.
Go to the top of the page
 
+Quote Post
michaelk
post Nov 15 2006, 09:02 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



Global configuration for all users are in the file /etc/profile. The default bash prompt will be something like:
PS1="\u@\h \W\\$
Which gives you the familar user@hostname$ prompt.

Each user in their home directory has a hidden file called .bash_profile where one can individualize their environment settings.

Have you deleted any files in the /etc directory?

What happens when you log on to the server itself instead of using putty?
Go to the top of the page
 
+Quote Post
DaveUK
post Nov 15 2006, 09:17 PM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 15-November 06
Member No.: 7,791



QUOTE (michaelk @ Nov 16 2006, 02:02 AM) *
Global configuration for all users are in the file /etc/profile. The default bash prompt will be something like:
PS1="\u@\h \W\\$
Which gives you the familar user@hostname$ prompt.

Each user in their home directory has a hidden file called .bash_profile where one can individualize their environment settings.

Have you deleted any files in the /etc directory?

What happens when you log on to the server itself instead of using putty?


Thanks for the quick reply!

I seem to be missing a .bash_profile?!?! i was deleting some files from the users root home dir and i may of accidentally deleted the file unsure.gif

If definitely gone... "ls -a"

How can i restore/rewrite the file?

TIA
Go to the top of the page
 
+Quote Post
michaelk
post Nov 16 2006, 06:17 PM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



You can copy it from another user. undeleting can be a little more difficult and depends on the filesystem. I assume you would be using ext3. You would need to remount the filesystem to ext2 and then use one of the several ext2 undelete utilities. Not knowing how your system is partitioned I suggest using a liveCD.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th October 2017 - 07:40 AM