From owner-freebsd-questions Sat Oct 14 13: 9:56 2000 Delivered-To: freebsd-questions@freebsd.org Received: from smtp03.mrf.mail.rcn.net (smtp03.mrf.mail.rcn.net [207.172.4.62]) by hub.freebsd.org (Postfix) with ESMTP id 329C737B66C for ; Sat, 14 Oct 2000 13:09:47 -0700 (PDT) Received: from ct-hartford-us401.javanet.com ([209.150.34.150]) by smtp03.mrf.mail.rcn.net with esmtp (Exim 3.15 #2) id 13kXcm-0002w4-00 for freebsd-questions@FreeBSD.ORG; Sat, 14 Oct 2000 16:09:45 -0400 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: freebsd-questions@FreeBSD.ORG From: media@ct1.nai.net Subject: Re: changing root shell?? Date: Sat, 14 Oct 2000 16:09:45 -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG First off, thanks to everyone for their help. >> I've been entering commands with sh syntax all along. I haven't >> received any syntax errors. Does this mean I could have trashed my >> system without knowing it?? >> >The odds are very very slim, especially considering that you received >no syntax errors that you have damaged your system at all. Whew!! Thanx :) It still amazes me that I haven't received any syntax errors, since afaik, sh and csh use very different syntax. I've also noticed some scripts are written in sh and some are written in csh -- how does the system know what to do?? >Changing your root shell to sh is fine. Just try and avoid stuff on /usr >without a damn good reason, and knowledge of the consequences. A basic way >to change your default editor is with sysinstall. I've read that I should avoid sysinstall after I've already installed because it can cause problems. >Ya know... all of this talk about changing root shells (again) has led me >to believe that the litrature that comes with fbsd, linux, etc just doesn't >make one thing clear enough to new unix users.... Root is only to be used >for select sys admin duties... not for browsing the web, or playing quake, >or editing graphics or whatever else... sheesh. Actually, _The Complete FreeBSD_ and _The FreeBSD handbook_ do make that clear. Even sysinstall suggests creating another account besides root for regular use. Regardless, I am doing sys admin duties (eg. trying to get my printer to work). What I think FreeBSD should make clear, is which shell is being used by root when you first install it. The welcome message should say "Listen you clueless newbie, root starts with the csh shell even though every other Unix system in your life has started with sh unless you changed it" or something similar :) >Setting the environment variable EDITOR will make some programs--vipw, >chsh, and crontab, for example--use the editor you specify. In >(t)csh, the syntax to do that is: "setenv EDITOR emacs" where emacs is >the editor you would like to use. I'm not sure about the (ba)sh >syntax, but I believe it's something like "export EDITOR=emacs". > >Hope this helps Thanx :) >You've got bash and relatives right. You might note that the actual >sequence for many things is VISUAL (if set), the EDITOR. This is true >for vipw, even though the man page doesn't mention it. The idea was >that you would get VISUAL if your termain could support a visual >editor, otherwise EDITOR. For bash, you can add that .profile, and >other things will inherit it. I don't understand. What is VISUAL?? >Give toor your chosen shell (chsh toor), assign her a password, and do >your root duties from that account, leaving the real root account with the >default shell. Best of both worlds, really, for about 99.5% of all >sysadmin duties on a production machine. If a 'toor' account was not >created on your system, just add another user after root with uid = 0, gid >= 0 and remake the password db. I thought toor was a backdoor for remote access in case one could not get into root. I've heard having toor activated is a possible security risk. I don't think I'll need toor since I can always boot from cd from the console. However, that is a good idea if I wanted to have tcsh or bash for doing root. How do I remake the password db?? >> My tcsh is in /usr/local/bin/tcsh, which wouldn't work in >>single user mode. > >That's bad. All files that are integral to the system (ie, required >for the system to boot in single user mode for rescue, recovery, >etc) should be in the root filesystem. sh and csh are in /bin and part of the FreeBSD install. I added tcsh and bash on my own, so they are in /usr/local/bin >So change it. Change it /bin/bash. Dynamically linked means that the >binary was linked to a shared object library that has to be loaded every >time you want to run the program. I have no clue why he would say that >you couldn't use it because it's dynamically linked. Of course you can >use it if it's dynamically linked. Just make sure that any libs that it >is linked to aren't out of reach in an emergency situation. They are on /usr not / While I have about 40M of space available on / (I made it 60M and only about 20M is currently used), I'm reluctant to arbitrarily add things to / >Edit /etc/passwd and change the /bin/sh or /bin/csh or what-have-you to >whatever you want your shell to be. I used chsh -s to change my root to sh, and myself as user (the guy who reads the man pages :) as bash. >vi is a superior editor, it just takes some getting used to. Once you >master the commands, editing with vi is quicker than any other editor out >there. I need an editor I can use right now to get my system configured, and many commands (eg. chsh) automatically call up vi. I'd like to spend less time in man vi, and more time getting things done. >I will concede that learning it takes a little bit of time, but >it's not too bad. Plus syntax coloring is really cool! If you find vi >cumbersome, you should use edlin, the line editor that came with older >versions of MSDOS. Wow, was that fun. I've used edlin, but choosing a particular application just because Microsoft came up with an even worse application for the same job isn't a very good reason :) >If you don't want to use vi, simply use another editor. Instead of typing >vi, type pico or type emacs (assuming these are installed). Some commands call up a default editor. I don't have pico and have no intention of going back to pine (maybe I'll try mutt, I'm using Eudora Pro on my LEM now -- I know you are mostly PC guys, but 040/7.6.1 is a rock). Imho, using emacs without X is silly (no flames, please) and wouldn't want to use X if I were fixing a problem as root. I'd like to set it to ee. Thanks again :) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message