Date: Mon, 29 Jun 2020 16:35:56 -0600 From: Brandon helsley <brandon.helsley@hotmail.com> To: Donald Wilde <dwilde1@gmail.com> Cc: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Shell Message-ID: <CY4PR19MB0104E3F1EDD5E2EF533D9447F96E0@CY4PR19MB0104.namprd19.prod.outlook.com> In-Reply-To: <CY4PR19MB010400AC4940C67421BFADE8F96E0@CY4PR19MB0104.namprd19.prod.outlook.com> References: <CY4PR19MB010400AC4940C67421BFADE8F96E0@CY4PR19MB0104.namprd19.prod.outlook.com> <CY4PR19MB010400AC4940C67421BFADE8F96E0@CY4PR19MB0104.namprd19.prod.outlook.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>
In order to modify your prompt, you need to alter the variable PS1 in
your .cshrc (C-shell startup file, note the starting '.') in your
/root directory. For your regular prompt, look in the .profile file in
/home/myuser.
>
.cshrc I found in the usr directory with .profile. I don't want to change the prompt for the usr, just for the csh shell for root. How do I do this if my .cshrc file is in usr directory?
>
> On Jun 29, 2020 at 3:51 PM, Donald Wilde <dwilde1@gmail.com> wrote:
>
>
> On 6/29/20, Brandon helsley <brandon.helsley@hotmail.com> wrote: > > > > There has been a difference in the hash sign of the command line. When I'm > logged in as user it is $. When I am logged in as root it is #, even when I > do not execute a shell. Usually it was root@machine17#. How do I change it > back? I have to do pwd instead of just knowing what directory I am in. > > The shell used for the root user is different than the shell used for a regular user, csh is leaner but also meaner than sh in many ways. Do some research: man csh. You can also get more examples on the web; google 'freebsd csh set prompt'. In order to modify your prompt, you need to alter the variable PS1 in your .cshrc (C-shell startup file, note the starting '.') in your /root directory. For your regular prompt, look in the .profile file in /home/myuser. I will warn you up front: the two shells are quite different. Save a backup of each of these files before you alter them. If your com
puter dumps you into shell mode without booting, having a .profile in /root is also a good idea. From the emergency shell you can 'source /home/myuser/.profile' -- Don Wilde **************************************************** * What is the Internet of Things but a system * * of systems including humans? * ****************************************************
>
From owner-freebsd-questions@freebsd.org Mon Jun 29 22:42:20 2020
Return-Path: <owner-freebsd-questions@freebsd.org>
Delivered-To: freebsd-questions@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55439357B90
for <freebsd-questions@mailman.nyi.freebsd.org>;
Mon, 29 Jun 2020 22:42:20 +0000 (UTC)
(envelope-from dpchrist@holgerdanske.com)
Received: from holgerdanske.com (holgerdanske.com [184.105.128.27])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "holgerdanske.com", Issuer "holgerdanske.com" (not verified))
by mx1.freebsd.org (Postfix) with ESMTPS id 49wjDC2kzkz4YVf
for <freebsd-questions@freebsd.org>; Mon, 29 Jun 2020 22:42:19 +0000 (UTC)
(envelope-from dpchrist@holgerdanske.com)
Received: from 99.100.19.101 ([99.100.19.101]) by holgerdanske.com with ESMTPSA
(TLS_AES_128_GCM_SHA256:TLSv1.3:Kx=any:Au=any:Enc=AESGCM(128):Mac=AEAD)
(SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN)
for <freebsd-questions@freebsd.org>; Mon, 29 Jun 2020 15:42:15 -0700
Subject: Re: Shell
To: freebsd-questions@freebsd.org
References: <CY4PR19MB010400AC4940C67421BFADE8F96E0@CY4PR19MB0104.namprd19.prod.outlook.com>
<CAEC7392icESwn=n=xNQD9nhGJgTcSegttBpfxwps3Rgv+7c9kA@mail.gmail.com>
From: David Christensen <dpchrist@holgerdanske.com>
Message-ID: <cb5e3d09-5716-efb5-cf74-33c967e52e19@holgerdanske.com>
Date: Mon, 29 Jun 2020 15:42:14 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.9.0
MIME-Version: 1.0
In-Reply-To: <CAEC7392icESwn=n=xNQD9nhGJgTcSegttBpfxwps3Rgv+7c9kA@mail.gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Rspamd-Queue-Id: 49wjDC2kzkz4YVf
X-Spamd-Bar: +++
Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none;
spf=none (mx1.freebsd.org: domain of dpchrist@holgerdanske.com has no SPF
policy when checking 184.105.128.27) smtp.mailfrom=dpchrist@holgerdanske.com
X-Spamd-Result: default: False [3.24 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[];
ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[];
FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];
NEURAL_SPAM_SHORT(0.98)[0.977]; MIME_GOOD(-0.10)[text/plain];
TO_DN_NONE(0.00)[];
PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org];
AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1];
NEURAL_SPAM_MEDIUM(0.56)[0.563];
DMARC_NA(0.00)[holgerdanske.com];
NEURAL_SPAM_LONG(0.80)[0.797];
RCVD_IN_DNSWL_NONE(0.00)[184.105.128.27:from];
R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[];
R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+];
ASN(0.00)[asn:6939, ipnet:184.104.0.0/15, country:US];
RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.33
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>,
<mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/>
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>,
<mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 29 Jun 2020 22:42:20 -0000
On 2020-06-29 14:51, Donald Wilde wrote:
> On 6/29/20, Brandon helsley <brandon.helsley@hotmail.com> wrote:
>>
>>
>>
>> There has been a difference in the hash sign of the command line. When I'm
>> logged in as user it is $. When I am logged in as root it is #, even when I
>> do not execute a shell. Usually it was root@machine17#. How do I change it
>> back? I have to do pwd instead of just knowing what directory I am in.
>>
>>
> The shell used for the root user is different than the shell used for
> a regular user, csh is leaner but also meaner than sh in many ways.
>
> Do some research: man csh.
>
> You can also get more examples on the web; google 'freebsd csh set prompt'.
>
> In order to modify your prompt, you need to alter the variable PS1 in
> your .cshrc (C-shell startup file, note the starting '.') in your
> /root directory. For your regular prompt, look in the .profile file in
> /home/myuser.
>
> I will warn you up front: the two shells are quite different. Save a
> backup of each of these files before you alter them. If your computer
> dumps you into shell mode without booting, having a .profile in /root
> is also a good idea. From the emergency shell you can 'source
> /home/myuser/.profile'
+1
Another option is to set the shell program for 'toor' to whatever is
desired, and then use that account for system administration tasks:
2020-06-29 15:38:09 toor@f3 ~/f3.tracy.holgerdanske.com
# head -n 4 /etc/passwd | tail -n 2
root:*:0:0:Charlie &:/root:/bin/csh
toor:*:0:0:Bourne-again Superuser:/root:/usr/local/bin/bash
Note that this implies you enable logins for 'toor' and install bash(1).
(I would not change the shell for root, as this could break your system.)
David
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CY4PR19MB0104E3F1EDD5E2EF533D9447F96E0>
