LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-17-2020, 01:22 PM   #1
DeanAnderson
LQ Newbie
 
Registered: Nov 2019
Posts: 19

Rep: Reputation: Disabled
how to switch to another user but not in console just in the whole ubuntu?


In console shell it is easy:
su new_user
then enter password.
But when edit file from user home in some text editor (not in vim in console), I cannot save file. I have to switch user also somehow in ubuntu and I don't know how.
 
Old 05-17-2020, 01:36 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,147
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
Open the text editor as <user>.
Example:
Code:
sudo geany /etc/fstab
 
Old 05-17-2020, 01:58 PM   #3
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,677

Rep: Reputation: Disabled
Does this answer work for you? (Lock the screen, switch to another user from the locked screen).
 
Old 05-17-2020, 03:47 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,766

Rep: Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933
When you just use the su new_user, you switch to the new user but remain in same directory even if you do not have permission to read or write with the old users environment.

If you use su - new_user versus just su new_user you switch to the new users environment and are automatically moved to the new_users home directory.
 
Old 05-17-2020, 04:44 PM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Logout and in as different user
 
Old 06-14-2020, 10:29 AM   #6
mredc
Member
 
Registered: May 2016
Location: USA
Distribution: Debian, Ubuntu
Posts: 73

Rep: Reputation: Disabled
I am curious as to whether any of these suggestions worked for the original poster. If so, which one(s).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] using switch in a function to call another function with a switch but it is not going into 2 switch ... BW-userx Programming 2 08-20-2017 11:47 PM
Encryption of the whole disk vs. a partition filling the whole disk taylorkh Linux - Security 5 09-19-2016 11:03 AM
[SOLVED] POE Switch powering another switch ? fritz001 Linux - Hardware 3 07-08-2014 12:35 PM
console: screen does not refresh until I switch back and forth to another VC patrickdepingui Linux - General 0 03-06-2003 10:30 AM
switch user for the whole KDE session, not just the Konsole glock19 Linux - General 2 12-12-2001 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration