In shell, delete key adds ~; not delete like expected?

TN68

Dabbler
Joined
Sep 24, 2022
Messages
31
Like the subject...

Expected behavior:
Web gui / jail / shell / nano-editing file
Delete key deletes character

Actual behavior:
Delete key adds "~"

Any advice or links to educate me on this?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Forward delete in Unix is Ctrl-D. Backspace should work as expected if your Terminal is configured correctly. Also the web UI shell function is limited and in some aspects broken. Better use SSH instead.
 

TN68

Dabbler
Joined
Sep 24, 2022
Messages
31
Thanks Patrick (also my first name...).
I did see that in another post, that "if you're doing this much copy/paste" you should use ssh w/ putty or equivalent. Then I had to fight putty keyboard setup... but mostly all set now. Thanks and have a good week.

It crushed my dreams a little, b/c clicking on the GUI SSH is just fun and easy, and was working for most stuff, but SSH is only slightly less convenient.
 

TN68

Dabbler
Joined
Sep 24, 2022
Messages
31
DOH! I working on this while too tired and did a "cd ~" while trying to work in a jail......... and installed Wireguard at root level instead of the jail.... i mistakenly was thinking cd ~ was going to take me back to the "jail root" not the system root.... this highlights a benefit of using the web UI shell in the jail... so you always are stuck working inside the jail on purpose (especially for mechE trying to be a hobbyist programmer).
-
I'll have to carefully try to undo what i did, or test-run a system restore i guess to wipe out the damage.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You need to enable sshd in each jail separately, then ssh to the jail's IP address/hostname.

Or ssh to the TrueNAS host and use iocage console <jailname>. Direct ssh is preferrable because you can also use scp etc.
 

TN68

Dabbler
Joined
Sep 24, 2022
Messages
31
then ssh to the jail's IP address/hostname
Ah - i didn't know you could SSH to the jail, i used the
Code:
iocage console 
route, which led to the
Code:
cd ~
error.

Thanks again!

I can test when i get home - but my dd-wrt makes the LAN subnet of 192.168.2.0; and I saw the jail IP is something like 172.xxx via CLI, would I use that or use some sub IP / port of the Truenas IP (192.168.2.2)?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Edit /etc/rc.conf inside the jail and add sshd_enable="YES".
Edit /etc/ssh/sshd_config to (temporarily) enable root login with password.

pkg install avahi-app; sysrc avahi_daemon_enable="YES" inside the jail to enable ssh <jailname>.local from your desktop system.

A jail is a complete virtual (container) FreeBSD installation. That's the glory of jails.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You probably configured your jail to use NAT. Don't. Using VNET and bridged networking you get a complete independent virtual environment connected to your LAN,
 

TN68

Dabbler
Joined
Sep 24, 2022
Messages
31
Ah - nice. So the router thinks it's just another physical device to assign an IP to, but it's just a jail. This is getting more fun by the minute. ha. Way beyond the original shell ~ issue i was facing (original subject) so thanks for all the additional thoughts. I did "NAT" for the jail just b/c whatever guides I was using said to... I will test out what you mentioned.
-
Primary benefit.... I used to have a rasp.Pi running doing simple stuff... .and you want to do another thing with it and debate adding yet another PI vs. complicating the current one.... but w/ trueNAS you can have like 10 "pi's" but really just 10 jails doing their assigned jobs (and running freebsd not pi OS).
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
but w/ trueNAS you can have like 10 "pi's" but really just 10 jails doing their assigned jobs
Exactly. Running only one major application (Nextcloud, Grafana, Guacamole, ...) in a jail greatly simplifies updates and related maintenance tasks.
 
Top