SSH to a new jail, prompt only $

Status
Not open for further replies.

petoniano

Dabbler
Joined
Feb 14, 2018
Messages
29
Hi, I wanted to try to install packages, for example the unrar pkg to unrar downloaded files. Also I use to SSH to the system to manage my files and so. I´ve read that it´s a bad idea to open the entire system to the world via SSH and it´s a better idea to create a jail, share storage with it and SSH that jail, and also install pkgs there.

So I followed the documentation to create a new Freebsd jail y and to enable SSH via the shell of the Freenas Graphic interface. And created a new user Carlos (me) and a group Family , marked "permit sudo"

I managed to SSH my jail from another computer and outside the network, but when I enter my password it apears a shell prompt that it´s only a $
not Carlos@my_jail:/$ or something like that. It´s difficult for me to go through directories without showing the path where I am. And when y type su and make the su password it appears a normal prompt.

What I´m doing wrong? When I type ls: there is no .cshrc file, it only appears when I am in su mode. It is there because I can read it with less .cshrc but no custom prompt showed.
I cannot ssh with root@my_jail because it says wrong password.

I´ve searched the forums and the User guide and haven´t found an answer. I need a litle help! thank you.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
it´s not possible to see the entire path in the prompt?
Of course it is. Figure out which shell your user is using, and edit its rc file (.bashrc, .cshrc, etc.) to set your prompt as desired.
 

petoniano

Dabbler
Joined
Feb 14, 2018
Messages
29
I think the shell is the problem, the user Carlos login tho the jain and uses sh shell, instead of csh (which prompt is set in the .cshrc file), and root user uses csh shell. I've tried to change it in the account>users menu but it already says shell: /bin/csh

Code:
ssh Carlos@192.168.0.3
Password for Carlos@freebsd_pkgs:
Last login: Sun Apr  1 00:10:47 2018 from 192.168.0.116
FreeBSD 11.1-STABLE (FreeNAS.amd64) #0 r321665+de6be8c8d30(freenas/11.1-stable): Tue Feb 20 02:38:09 UTC 2018

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories:   https://www.FreeBSD.org/security/
FreeBSD Handbook:	  https://www.FreeBSD.org/handbook/
FreeBSD FAQ:		   https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums:		https://forums.FreeBSD.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages:  man man
FreeBSD directory layout:	  man hier

Edit /etc/motd to change this login announcement.
To see the IP addresses currently set on your active interfaces, type
"ifconfig -u".
	   -- Dru <genesis@istar.ca>
$ cd /
$ ls
COPYRIGHT   etc	   media	   root	   tmp
bin	   home	   mnt	   sbin	   usr
boot	   lib	   proc	   sys	   var
dev	   libexec	   rescue	   
$ echo $SHELL
/bin/sh
$ su
Password:
root@freebsd_pkgs:/ # ls
.cshrc	   boot	   lib	   proc	   sys	   var
.profile   dev	   libexec	   rescue	   
COPYRIGHT   etc	   media	   root	   tmp
bin	   home	   mnt	   sbin	   usr
root@freebsd_pkgs:/ # echo $SHELL
/bin/csh
root@freebsd_pkgs:/ #

 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
So I followed the documentation to create a new Freebsd jail y and to enable SSH via the shell of the Freenas Graphic interface. And created a new user Carlos (me) and a group Family , marked "permit sudo"
Wait, what? If your concern is that you should ssh to the jail for security purposes, why are you doing this? Because none of this is going to have anything to do with the jail. Any of the settings in the web GUI are going to apply to the base FreeNAS system, not to the users in the jail.
 

petoniano

Dabbler
Joined
Feb 14, 2018
Messages
29
That's it!. You are right I mixed the user in the GUI and the user in the Jail.
I played with the commands to modify user accounts pw adduser rmuser... and after all the easiest way was to rmuser Carlos and create it again with adduser
And the problem was that the fist time I created that user I didn't specified csh as the shell (and was using sh instead of csh), now everything goes perfect.
Thank you very much
 
Status
Not open for further replies.
Top