On ssh connection console is looking different with different users. Why?

0

There are two users on my remote machine. One is olduser, another one is newuser.
Olduser ssh console is working and looking differently than newuser connection.
There are two folders for each user in /home/ directory, so probably newuser .bash_profile file is not working.

Newuser has been created by useradd -m command.
Newuser /home/ folder is missing files: .bash_history .ssh
Is it related with my problem?

How to get different and automatic console modes for each user (without additional commands each time I log in)?

cooba

Posted 2015-05-10T20:21:40.243

Reputation: 49

Why would you expect .ssh directory to be created? That's something each individual user must do. – snapshoe – 2015-05-10T21:08:32.603

@snapshoe: Hmm... .ssh directory maybe it's not very important, but probably .bash_history could be quite useful. – cooba – 2015-05-10T21:17:53.333

Then, run bash, and it will be created. – snapshoe – 2015-05-10T21:28:13.537

@snapshoe: What do you mean? I've got only ssh connection available and I'm connected with newuser account, but it's not creating .bash_history file. It's keeping somewhere my commands, but not in olduser and not in newuser .bash_history file. – cooba – 2015-05-10T22:12:53.637

@snapshoe Using the command bash is not changing anything, so this is confusing, but you don't have to be angry by that :) I just don't have so much experience like you. But OK, I've fixed it :) – cooba – 2015-05-10T22:34:07.507

Answers

3

The old user account likely has been set to use the bash shell, while the new one uses the default sh. Verify this using getent passwd olduser newuser, and if needed, change the shell using either usermod -s /bin/bash newuser or chsh.

user1686

Posted 2015-05-10T20:21:40.243

Reputation: 283 655

Thank you. Very good solution. It's fixing my problem, but still I don't see .bash_history and .ssh files in /home/newuser directory. – cooba – 2015-05-10T20:45:52.163

.bash_history may be created by bash when it is run. There are options to control its placement and naming. Unless the user creates it themself, .ssh isn't likely to be created until ssh is used an a manner that requires it. – BillThor – 2015-05-10T23:30:56.823