Closed vtacquet closed 1 year ago
Right click on the connect button, and select login shell. That will use the user profile settings.
that just goes 'denied', only root shell and login shell works (but that defaults to bash), can you set it default to what is in the user settings ?
What linux distro are you using? I cannot set it to use the user profile because only the login shell can do that, which is what that other option is for. If you tell me what distro you are using I can try and figure out why the login shell isn't working.
well it is a bit of a special case, an "ubuntu:latest" in a docker container, it is used for testing.
I assume you meant only root and user shell is working? Login shell spawns a login process which root and user shells do not.
the green ones work but give a colourless bash shell. the red one gives a denied
The login shell spawns a login process which is supposed to read the user profile. Is it prompting for a user name and password?
yes
That's interesting. Normally ssh client also spawns the same login process. I'll test with my ubuntu docker container tomorrow. Unless there's a different process I'm supposed to spawn in the docker container, I'm not sure if there's anything I can do. Normally the agent can't access the user profile script because it's running as a different user, which is why its supposed to rely on the login process to setup the environment.
I can confirm that the Denied is the same for a normal installation (outside of Docker). I do use zsh and Oh-My-Zsh.
Do you have user consent enabled? The user shell is supposed to spawn a process as the currently logged on user. The denied message looks like a user consent response. If no user is logged in, it should fail with a different error.
Does the login shell use colors outside of your docker container?
The video is a bit low quality but it is just to show you there is nothing there when using iTerm.
https://user-images.githubusercontent.com/5128967/104121648-2cd37500-5340-11eb-8bfa-7cb0a1bcfebd.mp4
Very strange but the Login shell has only partial colours... The motd still shows its colours but the prompt has lost all colours.
seems that with the Login shell the default TERM=xterm is set instead of TERM=xterm-256color
(the motd doesn't check the TERM settings so that is why it is in colours)
seems that with the Login shell the default TERM=xterm is set instead of TERM=xterm-256color
(the motd doesn't check the TERM settings so that is why it is in colours)
Thanks! I'll check to make sure this is set to xterm-256color
ok, I did a bunch of testing... It seems with the default TERM=xterm
colors seems to work fine with bash, both inside and outside a docker container.
I built a docker image with zsh, and I can't get the terminal to show with colors, even with TERM=xterm-256color
try with this Dockerfile, it will install Oh My Zsh (this changes the prompt to colours)
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=xterm-256color
RUN apt -y update && \
apt -y install zsh curl git
RUN yes | sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
ok thanks! I created a new docker image, and verified it works with the change. It will be in the next agent update.
MeshCentral v0.7.47 was released with Bryan fix for this. Let us know if it works.
Root and Login Shell now have colours, that's perfect but I still get the Denied on the User Shell.
Root and Login Shell now have colours, that's perfect but I still get the Denied on the User Shell.
If you are using docker, that is normal. The "user" shell, just spawns a shell with the UID of the logged in user. However, with docker, there is no "logged in user", or at least the agent can't determine the logged in user, because who
returns nothing.
This is not a docker test, this is just a regular Ubuntu 20.04 LTS (with zsh and Oh My Zsh).
This is not a docker test, this is just a regular Ubuntu 20.04 LTS (with zsh and Oh My Zsh).
That's wierd. I just tested on my Ubuntu 20.04 LTS, and it works fine. (granted I'm not using zsh, but I don't think that should be an issue)
If you click on the 'events' tab, does it show anything? If you connect a 'root' terminal, and type who,
what does it say? (Is there a user actually logged into this machine?) What does it say if you type users
on the console tab?
Hmm right, it is not related to zsh, I have it on hosts with bash too...
In the event viewer you see the disconnect immediately (0 seconds) this is a zsh
this is a bash
@si458 can close
Is there a reason why using the Terminal in MeshCentral does not use the user's shell settings and 'environment' ?
When logging on with a normal SSH terminal client the shell is zsh and has colours
When logging on with MeshCentral Terminal the shell is bash and has no colours
User has zsh as default shell