LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to login in from separate terminals in same OS instance? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-login-in-from-separate-terminals-in-same-os-instance-4175589429/)

fanoflq 09-14-2016 01:51 PM

How to login in from separate terminals in same OS instance?
 
CentOs 7

I used su to login as root.
I created several accounts,e.g. a1, b1, c1

Then I created two groups, gp1, gp2, and a directory, test
with owner a1, and group as gp1.

Then I added gp1 to a1.
Now I like to test permissions via
login on 3 terminals for a1, b1, and c1.

But whenever I am in root and did this:
Code:

[root@localhost ~]# login a1

The terminal closed immediately.


And when in another user account with admin privileges,
I do not get prompted for password.
Nothing happens.
the prompt just returns.... like so:
Code:

[user1@localhost ~]$ login a1
[user1@localhost ~]$

Here are the created accounts:
Code:

... ...
user1:x:1000:1000:user1:/home/user1:/bin/bash
a1:x:1001:1001::/home/a1:/bin/bash
b1:x:1002:1002::/home/b1:/bin/bash
c1:x:1003:1003::/home/c1:/bin/bash

I am able to login to another account if I logged off from current account. But this does not allow me to test permissions quickly!

How to login in from separate terminals in same OS instance?
Meaning all login accounts are active (not log-off), and I can easily switch between them via the terminals.

Thank you.

Emerson 09-14-2016 01:55 PM

Not sure if I understand your problem.
Code:

su - user1
will log you in as user1 from your root account. Ctrl+D will log you out back to your root login.

fanoflq 09-14-2016 02:04 PM

@Emerson :

That did the trick.
Thank you.

chrism01 09-15-2016 03:26 AM

Fyi, 'exit', will also log you out of the other acct and back to the original. Its just a another terminal session, no special handling reqd.


All times are GMT -5. The time now is 10:54 PM.