config ZSH shell as defoult shell in cubic

Asked by crazyfox

Is it posible to put ZSH and oh-my-zsh as defout shell , out of a box? And is it posible to configure it pre-instalation?

Question information

Language:
English Edit question
Status:
Solved
For:
Cubic Edit question
Assignee:
No assignee Edit question
Solved by:
Cubic PPA
Solved:
Last query:
Last reply:
Revision history for this message
Best Cubic PPA (cubic-wizard) said :
#1

I ~think~ something like this should work...

1. List available shells

$cat /etc/shells

    # /etc/shells: valid login shells
    /bin/sh
    /bin/bash
    /usr/bin/bash
    /bin/rbash
    /usr/bin/rbash
    /bin/dash
    /usr/bin/dash

2. Install zsh

$ sudo apt-get install zsh

3. List available shells to make sure zsh was installed.

$cat /etc/shells

4. Change the default shell for all new users

$ nano /etc/default/useradd
# Change "SHELL=/bin/sh" to "SHELL=/bin/???" where ??? represents the new shell you want to use from step 3.

5. Configure zsh for all new users.

# Copy a valid ".zshrc" configuration file into the /etc/skel folder, so new users get the correct configuration.
# You can get the ".zshrc" from your current home directory on your host machine if you are currently running zsh.

6. Change the default shell for the root user

$ nano /etc/passwd
# Find the line "root:x:0:0:root:/root:/bin/bash"
# and change "/bin/bash" to "???" where ??? represents the new shell you want to use from step 3.

7.
# Copy a valid ".zshrc" configuration file into the /root folder, so the root users get the correct configuration.
# You can get the ".zshrc" from your current home directory on your host machine if you are currently running zsh.

(Please note, I've never tried this, and I don't know if Cubic's virtual terminal environment will continue to work, once you change the root user's shell in Cubic. If you try it, please let me know what happens).

Revision history for this message
Cubic PPA (cubic-wizard) said :
#2

I think you would simply install oh-my-zsh as follows.

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

This should modify your ~/.zshrc file, so you will want to make sure you update /etc/skel/.zshrc with this newer version.

Revision history for this message
Cubic PPA (cubic-wizard) said :
#3

ADDITIONALLY, in Comment #1, Step Number 4, also do the following...

$ nano /etc/adduser.conf

Change "DSHELL=/bin/bash" to "DSHELL=/bin/???" where ??? represents the new shell you want to use.

Revision history for this message
crazyfox (crazyfoxsr) said :
#4

Thanks Cubic PPA, that solved my question.