Hi Community,

I have sort of a weird problem. I used to connect to a server (OS Ubuntu Server) through putty and everything worked fine. Now we had to reinstall the server from the beginning and after that my putty does not work as before. It doesn't show me the current directory and when I press the arrowkeys I get ^[[C^[[A ... It still works fine on another machine with putty.
I searched already the internet but couldn't find any pointer to a solution. Do you have any ideas? Btw. we run openSSH on the server.

Thanks in advance.

Dani AI

Generated

's follow‑up actually points to the root cause: this was a server-side account setup issue, not a PuTTY bug. The symptom — no “current directory” in the prompt and arrow keys echoing as escape sequences (e.g. ^[[C) — typically means the login environment and line‑editing (readline) setup for the user are missing or the user is running a non‑interactive/non‑readline shell. On Debian/Ubuntu the interactive helper adduser sets up a home directory, copies /etc/skel (where .bashrc/.profile live) and gives a normal login shell; the low‑level useradd call will not do all of that unless you pass the right options.

Quick checks to confirm (run as root or with sudo):

# shows home directory and login shell for the account
getent passwd username

# look for dotfiles that set PS1/readline in the home
ls -la /home/username

# when logged in as that user, show the running shell and TERM
ps -p $$ -o comm=
echo $SHELL
echo $TERM

If the home dir is missing, or there is no .bashrc/.profile (or the account is using a shell like /bin/sh//bin/dash), the prompt and arrow‑key editing behaviour will be absent.

Fixes that restore the expected behaviour:

# create/copy skeleton files and fix ownership
sudo mkdir -p /home/username
sudo cp -a /etc/skel/. /home/username/
sudo chown -R username:username /home/username/

# set bash as the login shell
sudo usermod -s /bin/bash username

On Debian/Ubuntu you can also run sudo mkhomedir_helper username or recreate the account with adduser username. For future user creation, prefer adduser or use useradd -m -k /etc/skel -s /bin/bash to match adduser behaviour. After changes, re‑login (or restart the PuTTY session). Avoid copying root’s custom dotfiles verbatim — ensure permissions and ownership are correct.

EDIT: I have just figured out, that I have the same behaviour wtih my account when I physically login to the server... (so arrow keys also doesn't work and no display for current directory)

Why could that be? the only "special thing" we've done, was to put me to the sudoers.

okay, I finally solved it. We created the user with useradd... but when I create a new user with adduser... it works!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.