# IBM AS/400 - Setup Telnet 5250 Server

Podalirius · 2025-09-10

<https://podalirius.net/en/mainframe/ibm-as-400-telnet-5250-setup/>

The IBM AS/400 Telnet server provides 5250 terminal access over TCP/IP. In this article, we will see how to configure and enable the Telnet 5250 service on an AS/400 running OS/400 V4R4.

## Introduction

The IBM AS/400 provides interactive access to the system through 5250 terminals. Traditionally this was done using Twinax terminals (like the InfoWindow II), but with the arrival of TCP/IP support, IBM introduced a telnet server  to allow 5250 sessions over the network.  

In this article, we will see how to configure and start the Telnet 5250 service on an AS/400 9401-150 running OS/400 V4R4, so that users can connect with 5250 emulators remotely.

## Requirements

Before enabling the Telnet server, make sure that:
- TCP/IP is configured and active on your AS/400 ([see this article on TCP/IP configuration](<https://podalirius.net/en/mainframe/ibm-as-400-tcp-ip-setup/>))
- You can log in with security officer authority (`QSECOFR`)
- A 5250 emulator (such as Mocha TN5250, tn5250j, or IBM Access Client Solutions) is available on your workstation

## Starting TCP/IP

First, ensure that TCP/IP is active. You can check the status with:

```
WRKTCPSTS
```

If it is not active, start it:

```
STRTCP
```

## Starting the Telnet server

The Telnet server is managed as a TCP/IP server job named `QTVTELNET`, which normally runs inside the subsystem `QSYSWRK`.

To start it, use:

```
STRTCPSVR SERVER(*TELNET)
```

You can confirm it is running with:

```
WRKACTJOB SBS(QSYSWRK)
```

Look for a job named `QTVTELNET`.

## Enabling interactive subsystem

Telnet sessions require the interactive subsystem `QINTER` to be active. If it is not running, start it with:

```
STRSBS SBSD(QINTER)
```

Without `QINTER`, users will not receive a sign-on screen.

## Allowing virtual terminals

Telnet 5250 sessions use virtual display devices named `QPADEVxxxx`. The system value `QAUTOVRT` controls how many such devices can be created.

Check its value with:

```
DSPSYSVAL QAUTOVRT
```

If it is `0`, no Telnet sessions can be created. Change it to a reasonable value (for example, 200):

```
CHGSYSVAL SYSVAL(QAUTOVRT) VALUE(200)
```

## Allowing QSECOFR authority to login remotely

By default, the Telnet server does not allow the `QSECOFR` authority to login remotely. Check system value `QLMTSECOFR` to see if it is set to `*NO`.

Display it:

```
DSPSYSVAL QLMTSECOFR
```

If it is set to `1`, change it to `0` (the single quotes are important in the command):

```
CHGSYSVAL SYSVAL(QLMTSECOFR) VALUE('0')
```

## Testing the connection

From your workstation, start a 5250 emulator and connect to the AS/400 IP address on port 23.  

If everything is configured correctly, you should see the sign-on screen:

![](<https://podalirius.net/en/mainframe/ibm-as-400-telnet-5250-setup/signon_screen.png>)

At this point, you can log in with a valid AS/400 user profile.

## Autostarting Telnet at IPL

To avoid manually starting Telnet after each IPL, you can configure it to autostart.

### Method 1: Network server configuration

Enable autostart for the Telnet server:

```
CHGNETSVR SERVER(*TELNET) AUTOSTART(*YES)
```

Verify with:

```
WRKNETSVR
```

### Method 2: Startup program

Alternatively, add the Telnet start command to the system startup program:

1. Check the startup program:
   ```
   DSPSYSVAL QSTRUPPGM
   ```
2. Edit the CL program (usually `QSYS/QSTRUP`)
3. Add:
   ```
   STRTCPSVR SERVER(*TELNET)
   ```
   after `STRTCP`

This ensures that Telnet starts automatically whenever the system IPLs.


## References
- [IBM Start TCP/IP (STRTCP)](https://www.ibm.com/docs/en/i/7.4?topic=ssw_ibm_i_74/cl/strtcp.htm)  
- [IBM Start TCP/IP Server (STRTCPSVR)](https://www.ibm.com/docs/en/i/7.4?topic=ssw_ibm_i_74/cl/strtcpsvr.htm)  
- [IBM System Values: QAUTOVRT](https://www.ibm.com/docs/en/i/7.4?topic=ssw_ibm_i_74/rzarl/rzarlqautovrt.htm)  
- [Mocha TN5250 Emulator](https://www.mochasoft.dk/tn5250.htm)  
- [tn5250j Project](http://tn5250j.sourceforge.net/)  
