I want to create a user using useradd from root in my terminal window, after it I call passwd to set user's password.
- So I cant call
login usernamebecause when I call it from terminal it closes terminal's window. - I can write
loginand then write user's name but this does not work because it says thatLogin incorrect. - I can call
su userto login as new user. This command will allow me to work with new user. - I can login to my new user from graphical login window (startup login window)
- If I write from terminal
init 3, then I can write my user's name and password and login - I can login as new user if my OS is running in non graphical mode.
I tested it in CentOS 5.5,6.5. I want to login as new user using login command from terminal when my OS is running in grephical mode. How can I do it?
SOLUTION:
Someone adviced me to call su -l user
login(not su)command from terminal when my OS is running in grephical mode. This thing I need for my administrative needs.suyet that's exactly whatsuis for. You could useloginas well, I suppose. I don't know what you mean by "halts my terminal" because I am able to runloginfrom a terminal and it works just fine.login, and you don't likesu, then how abouttelneting orsshing tolocalhostand logging in (as the new user) that way?logincommand works only in certain circumstances. Running in a pty opened by the window system is unfortunately not one of those circumstances.