vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all. I have many OpenBSD machines and I have customized the prompt to display time, user currently logged in and server name. My question is when I log in as a user and I su to root the root prompt does not seem to use my customized prompt. BTW, I'm using Bash 2.05 static. Now I have changed the shell to bash for the root account. The customized prompt displays fine as long as I do not su in. Below is the code I used in the file .profile and what is lookes like after being parsed. Any ideas? Am I going about this wrong or missing a file to change? ..profile -------- PS1="\n\@ [\u]\n\h:" After being parsed 01:10 PM [username] servername: |
| |||
| I login wiht my user account and type "su". Type in the root password and done. Why should I stick with csh? Either way the prompt does not change when I su to root. --- Original Message --- > "Adam" <webmasterNO@SPAMvenmarces.com> wrote in message > news:vgu3o3nius6j05@corp.supernews.com... > >>Any ideas? Am I going about this wrong or missing a file to change? >> > How do you su? > #su - > ? > > Then the shell of root runs it's profile-script (I suspect standard csh) |
| |||
| "Adam" <webmasterNO@SPAMvenmarces.com> wrote in message news:vgu5ur85mld7f1@corp.supernews.com... > I login wiht my user account and type "su". Type in the root password > and done. Why should I stick with csh? Either way the prompt does not > change when I su to root. the user you logon with doesn't have to have the same shell as root, and thus other environment variables. Whenever you su, you become another user (with another environment). If you want to want root to have the same prompt, you have to change the default shell of root to whatever the shell of the user is. This is not wise, though. I suggest keeping standard csh for root. Peter |
| |||
| > As I mentioned before I have already changed the root's shell to bash. > Why is it so curcial to keep root's shell to csh? > Bash is in /usr/local/bin, while csh is in /bin/csh. Most people keep /usr apart from /. When something happens to your /usr, root cannot logon (apart from in single mode). But back to the original issue: if you want root to have the same prompt, you'll have to export this in roots' profile, and then do a #su - (mind the dash) Peter |
| ||||
| Ahh I see your point. Good reason. If I change the installation of bash to store it in /bin/ that would reolve any issues that might occur if /usr/ happen to get damaged. Ahhh cool, thanks. I was reading the man pages for su and it looks like - is deprecated. From what I understand -l is what I should use. Thanks for the help, much appreciated! --- Original Message --- > Bash is in /usr/local/bin, while csh is in /bin/csh. > Most people keep /usr apart from /. When something happens to your /usr, > root cannot logon (apart from in single mode). > > But back to the original issue: if you want root to have the same prompt, > you'll have to export this in roots' profile, and then do a > > #su - > > (mind the dash) |