Question: Does anyone know of any methods to perform a "second" login without using su, or a means to use su that requires the user to enter their username after the su command is issued?
Situation: We have multiple types of devices that login to a Linux server. The users can then choose from options on a menu to execute. The devices auto login to the system with a different account for each device. The reason we do this is to limit the number of setup accounts to maintain on the devices to one per device. The ssh clients we have that we can use all tie an automatic login name to the device account in use (see Juice ssh on android for one example). Maintaining 40 plus accounts per device on each app is too much overhead for us.
Goal: After the device logs in (primary login) provide a secondary login for the user that will allow them to enter their user id and password.
My first inclination would have been 'su', but 'su' needs a username provided with the command or it defaults to root account. To keep things simple, I am trying avoid writing more shell code to prompt for the username before issuing a command such as 'su - $username' to accomplish this.
Naturally, any application they login to already asks for username and password, but dropping to the shell and other home built functions rely on the login to provide authentication.