SSH answers “This service allows sftp connections only.”
A customer's SSH login prints This service allows sftp connections only. and closes. OpenSSH gives the customer SFTP access only until an administrator enables shell access.
Symptoms
An SSH login as the customer prints the following message and closes.
This service allows sftp connections only.With ssh -t, the login prints PTY allocation request failed on channel 0 instead. SFTP works with the same login and password.
Cause
A customer gets a shell when an administrator enables it. Until then, sshd runs only SFTP for that customer, confines them to their home folder, and gives them no terminal.
Resolution
Give the customer a shell.
urbestack-user-set --name USER --shell onCheck the customer's login shell.
getent passwd USERThe entry shows
/bin/bashas the login shell, and the customer can log in over SSH.Use
--shell offto remove shell access again. Both settings leave the files on disk intact.