Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a basic question,am logging to a linux box using securecrt with my username and password,it has my username and password saved,i want to login using a different username to the same linux box,how do I do that?since I am already logging and the data is saved,everytime I login its automatically logging with current credentials

share|improve this question
    
Actually I am confused with your question. you want to login as a multiple user or you want to access the same account with two different user name ? can you be more specified? –  max Jan 5 '13 at 6:18
add comment

migrated from stackoverflow.com Jan 4 '13 at 9:17

This question came from our site for professional and enthusiast programmers.

2 Answers

You can use su username - assuming you have the username setup. For more info on su, you can use man su on command prompt which will give you all the details.

NAME
       su - change user ID or become superuser

SYNOPSIS
       su [options] [username]

DESCRIPTION
       The su command is used to become another user during a login session. 
       Invoked without a username, su defaults to becoming the superuser. The
       optional argument - may be used to provide an environment similar to 
       what the user would expect had the user logged in directly.
share|improve this answer
add comment

I think it will work for you, try this

First create 2 users user1 and user2

[root@localhost ~]# useradd user1
[root@localhost ~]# passwd user1
Changing password for user user1.
New password: 
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@localhost ~]# useradd user2
[root@localhost ~]# passwd user2
Changing password for user user2.
New password: 
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password: 
passwd: all authentication tokens updated successfully.

In /etc/passwd file change this

user1:x:502:502::/home/user1:/bin/bash
user2:x:503:503::/home/user2:/bin/bash

To This

user1:x:502:502::/home/user1:/bin/bash
user2:x:502:502::/home/user1:/bin/bash

Now If you login from user2 then user1 home directory will open. Note

Here passwd for user1 is user1 and for user2 is user2

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.