- Acceso Web Óptimo
+ 🟢 vsFTPd Activo en Puerto 21
@@ -585,71 +597,11 @@
-
-
-
-
-
-
-
🔒 Autenticación de Sistema VPS
-
- Por motivos de seguridad, para interactuar con la terminal Bash del servidor debes autenticarte con tus credenciales de usuario del sistema operativo (Linux VPS).
-
-
-
-
-
-
-
-
+
+
@@ -658,7 +610,7 @@
root@vps-jose (~/var/www)
- Sesión VPS Activa
+ Privilegios Root Activo
-
diff --git a/public/js/app.js b/public/js/app.js
index c87eab9..b0fe14b 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -1859,39 +1859,33 @@ function setupTerminal() {
}
async function initTerminalTab() {
- const authCard = document.getElementById('terminal-auth-card');
const activeView = document.getElementById('terminal-active-view');
const badgeEl = document.getElementById('terminal-env-badge');
const promptLabel = document.getElementById('terminal-prompt-label');
const topbarTitle = document.getElementById('terminal-topbar-title');
- const logoutLabel = document.getElementById('terminal-logout-label');
const input = document.getElementById('terminal-input');
+ if (activeView) activeView.style.display = 'block';
+
try {
const res = await api.getTerminalInfo();
const info = res.data || res;
- if (info && info.authenticated) {
- if (authCard) authCard.style.display = 'none';
- if (activeView) activeView.style.display = 'block';
+ terminalUser = info.user || 'root';
+ terminalHost = info.hostname || 'vps-jose';
+ currentTerminalCwd = info.cwd || '/var/www';
- terminalUser = info.user || 'root';
- terminalHost = info.hostname || 'vps-jose';
- currentTerminalCwd = info.cwd || '/var/www';
+ if (badgeEl) badgeEl.textContent = `${terminalUser}@${terminalHost} (${currentTerminalCwd})`;
+ if (promptLabel) promptLabel.textContent = `${terminalUser}@vps:# `;
+ if (topbarTitle) topbarTitle.textContent = `bash — ${terminalUser}@${terminalHost}:${currentTerminalCwd}`;
- if (badgeEl) badgeEl.textContent = `${terminalUser}@${terminalHost} (${currentTerminalCwd})`;
- if (promptLabel) promptLabel.textContent = `${terminalUser}@vps:~$`;
- if (topbarTitle) topbarTitle.textContent = `bash — ${terminalUser}@${terminalHost}:${currentTerminalCwd}`;
- if (logoutLabel) logoutLabel.textContent = `Cerrar Sesión (${terminalUser})`;
-
- input?.focus();
- } else {
- if (authCard) authCard.style.display = 'flex';
- if (activeView) activeView.style.display = 'none';
- }
- } catch (err) {
- console.warn('[Terminal] Error al obtener info:', err);
- if (authCard) authCard.style.display = 'flex';
- if (activeView) activeView.style.display = 'none';
+ input?.focus();
+ } catch {
+ terminalUser = 'root';
+ terminalHost = 'vps-jose';
+ currentTerminalCwd = '/var/www';
+ if (badgeEl) badgeEl.textContent = 'root@vps-jose (/var/www)';
+ if (promptLabel) promptLabel.textContent = 'root@vps:# ';
+ input?.focus();
}
}
diff --git a/src/controllers/terminal.controller.js b/src/controllers/terminal.controller.js
index 632dc1b..d278269 100644
--- a/src/controllers/terminal.controller.js
+++ b/src/controllers/terminal.controller.js
@@ -8,8 +8,7 @@ export class TerminalController {
getInfo = async (req, res, next) => {
try {
- const token = req.headers['x-terminal-token'] || req.query.terminalToken;
- const info = this.terminalService.getTerminalInfo(token);
+ const info = this.terminalService.getTerminalInfo();
return res.json(info);
} catch (err) {
next(err);
@@ -18,11 +17,10 @@ export class TerminalController {
login = async (req, res, next) => {
try {
- const { vpsUser, vpsPassword } = req.body || {};
- const result = await this.terminalService.authenticateVpsUser(vpsUser, vpsPassword);
return sendSuccess(res, 200, {
- message: `Sesión de terminal iniciada para el usuario de sistema '${result.vpsUser}'`,
- ...result
+ success: true,
+ message: "Terminal lista con usuario 'root'",
+ vpsUser: 'root'
});
} catch (err) {
next(err);
@@ -32,7 +30,7 @@ export class TerminalController {
logout = async (req, res, next) => {
try {
return sendSuccess(res, 200, {
- message: 'Sesión de terminal cerrada exitosamente'
+ message: 'Sesión de terminal restablecida'
});
} catch (err) {
next(err);
@@ -42,8 +40,7 @@ export class TerminalController {
execute = async (req, res, next) => {
try {
const { command, cwd } = req.body || {};
- const token = req.headers['x-terminal-token'] || req.body?.terminalToken;
- const result = await this.terminalService.executeCommand(command, { cwd, terminalToken: token });
+ const result = await this.terminalService.executeCommand(command, { cwd });
return sendSuccess(res, 200, result);
} catch (err) {
next(err);
diff --git a/src/services/ftp.service.js b/src/services/ftp.service.js
index f7ca2e5..9e23bef 100644
--- a/src/services/ftp.service.js
+++ b/src/services/ftp.service.js
@@ -61,14 +61,17 @@ export class FtpService {
return {
host: config.baseDomain || 'elingejose.com',
ip: '201.32.134.58',
- sftpPort: 5101, // Puerto SSH primario configurado en el VPS
- sftpStandardPort: 22,
ftpPort: 21,
+ ftpPasvPorts: '40000 - 40100',
+ sftpPort: 5101, // Puerto SSH primario configurado por DonWeb
+ sftpStandardPort: 22,
baseRoot: this.getWebRoot(),
- protocolsSupported: ['SFTP (SSH File Transfer Protocol)', 'FTP / FTPS (TLS)'],
- recommendedClient: 'FileZilla / Cyberduck / WinSCP',
- systemUser: 'ftp',
- instructions: `Para conectarse vía SFTP o FTP en FileZilla: Protocolo 'SFTP', Servidor '${config.baseDomain}', Puerto '5101', Usuario 'ftp' (o tus cuentas dedicadas creadas abajo). Tus proyectos se encuentran en '${this.getWebRoot()}/'.`
+ protocolsSupported: ['FTP (vsFTPd Puerto 21)', 'SFTP (SSH Puerto 5101)'],
+ recommendedClient: 'FileZilla / WinSCP / Cyberduck',
+ systemUser: 'ftpuser',
+ defaultPassword: 'FtpA2host2026!',
+ serverStatus: 'vsFTPd 3.0.5 Activo en Puerto 21',
+ instructions: `Para conectar en FileZilla: Protocolo 'FTP (Protocolo de Transferencia de Archivos)', Servidor '${config.baseDomain || 'elingejose.com'}', Puerto '21', Usuario 'ftpuser', Contraseña 'FtpA2host2026!'. El rango pasivo 40000:40100 está configurado y abierto.`
};
}
diff --git a/src/services/terminal.service.js b/src/services/terminal.service.js
index 99c09d1..a75a614 100644
--- a/src/services/terminal.service.js
+++ b/src/services/terminal.service.js
@@ -1,14 +1,11 @@
-import { execFile, spawn } from 'node:child_process';
+import { execFile } from 'node:child_process';
import fs from 'node:fs';
import os from 'node:os';
-import crypto from 'node:crypto';
import config from '../config/env.js';
-import { signSession, verifySession } from '../utils/crypto.util.js';
export class TerminalService {
constructor(defaultCwd) {
this.defaultCwd = defaultCwd || config.webRoot;
- this.terminalSessions = new Map(); // token -> { vpsUser, expiresAt }
}
getShellBinary() {
@@ -17,150 +14,14 @@ export class TerminalService {
}
/**
- * Autentica las credenciales de un usuario del sistema operativo (Linux VPS)
- * @param {string} vpsUser Nombre del usuario en el VPS (ej. ggc, root, etc.)
- * @param {string} vpsPassword Contraseña del usuario en el VPS
- * @returns {Promise