0

A question to user account of Ubuntu 16.04. I am newby to Ubuntu/Linux OS.
I hosted a server and was logged in with ssh (putty client side) and the default root account with all permissions. I created a new user with adduser newuser. I swapped user with su -newuser and checked whoami and was the newuser.

  1. Why i haven't lost the connection with ssh? On windows you get kicked out (pretty sure).

  2. Before i made the newuser i installed MySql with root user. I tried to login after swapping accounts. When you don't enter a username for MySql it takes the name of the logged in account name. Curiously for MySql i was root, even whoami said i am newuser?

After i made a new connection with ssh and "newuser" MySql registered me properly.

Why could i make a connection with ssh even i haven't setted it up (thing of groups?)?

What's the concept of user in Ubuntu. Only access on files and programs?

At least i wan't the make the server secure. I use the https://help.ubuntu.com/16.04/serverguide/serverguide.pdf. Might there be a better documentation - i am computer scientist, so it must not be for dummies - with a little bit more background stuff?

Thanks and kind regards

Julien

  • 1
    From the man pages: For backward compatibility, su defaults to not change the current directory and to only set the environment variables HOME and SHELL (plus USER and LOGNAME if the target user is not root). It is recommended to always use the --login option (instead of its shortcut -) to avoid side effects caused by mixing environments. – RobotHumans Jul 26 '18 at 19:08
  • Aside from sharing a name ("root"), there is no relation between the mysql root user and the OS root user - see for example User for mysql database – steeldriver Jul 26 '18 at 20:13
  • Too many questions ..... – Panther Jul 26 '18 at 20:17
  • ssh_on_client --> sshd on server, spawns login shell, which gets info from /etc/group, which spawns another shell via newgrp. When the newgrp shell exits, one is back in the login shell started by sshd. – waltinator Jul 26 '18 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.