wget not working in cron; jailshell problem?

flexjoly

Verified User
Joined
Nov 2, 2016
Messages
92
Location
Apeldoorn, Netherlands
Hi,

I am trying to do a wget from an external url. Logged in as root, it works fine (manually). But as a cron the connection is refused. Chatgpt tells me it may have to do with different shell and even because of jailshell.

So I changed the shell to /bin/bash

Jailshell is installed with custombuild. But I cannot find how to remove it there.
I changed directadmin.conf to "jail=0".
In the user settings: jailed is not checked.

But the cron still does not work.

user crontab:
Code:
000=52 * * * * /usr/bin/wget --inet4-only -O /home/client/domains/xxxx.com/files/front/prodvar_$(date +\%Y\%
m\%d_\%H\%M\%S).json "https://ftbserv.xxxx.cloudapp.azure.com:3000/xxxx"  >> /home/client/domains/xxxx.com/files/download_front.log 2>&1
001=52 * * * * env > /home/client/domains/xxxx.com/files/cron_env.log
MAILTO=
PATH=/usr/local/php82/bin:/home/client/.local/bin:/home/client/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/bin:/usr/l
ocal/sbin:/usr/sbin
SHELL=/bin/bash

What am I doing wrong? And how to remove jailshell?

Thanks in advance!
 
Last edited:
Login as the user or su to the user and try the wget command. If there is an error of some kind then it will tell you.
 
Hi floyd,

Tx for your reply.
Login as the user or su to the user and try the wget command. If there is an error of some kind then it will tell you.

I did that. In root it works fine. Under su <user> the only error I got was:
Code:
failed: Connection refused.

Thanks to your reply, I thought: let me see if there is a debug. But it does not give much more info.

With root the wget functions as expected (I stopped it, because it is a large download)
Code:
[root@vps2 admin]# wget -d https://ftbserv.xxx.cloudapp.azure.com:3000/xxx/xxxxx
DEBUG output created by Wget 1.21.1 on linux-gnu.

Reading HSTS entries from /root/.wget-hsts
URI encoding = ‘UTF-8’
Converted file name 'xxxxx' (UTF-8) -> 'xxxxx' (UTF-8)
--2025-10-06 09:54:23--  https://ftbserv.xxx.cloudapp.azure.com:3000/xxx/xxxxx
Certificates loaded: 373
Resolving ftbserv.xxx.cloudapp.azure.com (ftbserv.xxx.cloudapp.azure.com)... 13.93.195.68
Caching ftbserv.xxx.cloudapp.azure.com => 13.93.195.68
Connecting to ftbserv.xxx.cloudapp.azure.com (ftbserv.xxx.cloudapp.azure.com)|13.93.195.68|:3000... connected.
Created socket 3.
Releasing 0x000055f4b999b1e0 (new refcount 1).

---request begin---
GET /xxx/xxxxx HTTP/1.1
User-Agent: Wget/1.21.1
Accept: */*
Accept-Encoding: identity
Host: ftbserv.xxx.cloudapp.azure.com:3000
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... ^C
[root@vps2 admin]#

But with the user that needs the cron, the connection is refused:

Code:
[root@vps2 admin]# sudo -u client -H wget -d https://ftbserv.xxx.cloudapp.azure.com:3000/xxx/xxxxx
DEBUG output created by Wget 1.21.1 on linux-gnu.

Reading HSTS entries from /home/client/.wget-hsts
URI encoding = ‘UTF-8’
Converted file name 'xxxxx' (UTF-8) -> 'xxxxx' (UTF-8)
--2025-10-06 09:53:24--  https://ftbserv.xxx.cloudapp.azure.com:3000/xxx/xxxxx
Certificates loaded: 373
Resolving ftbserv.xxx.cloudapp.azure.com (ftbserv.xxx.cloudapp.azure.com)... xxxxx
Caching ftbserv.xxx.cloudapp.azure.com => xxxxx
Connecting to ftbserv.xxx.cloudapp.azure.com (ftbserv.xxx.cloudapp.azure.com)|xxxxx|:3000... Closed fd 3
failed: Connection refused.
Releasing 0x000055965c4a3200 (new refcount 1).

I hope someone can tell me, how to solve this.
Thanks!!
 
ChatGPT weet inderdaad ook niet alles. :D
Maar let op, ChatGPT en AI geven ook nog regelmatig fouten in hun antwoorden, dus ik zou daar nooit klakkeloos op vertrouwen of uitsluitend op basis van ChatGPT belangrijke dingen gaan wijzigen.

P.s. smtalk does not speak Dutch. ;)
 
Back
Top