LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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: 18

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
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 2,909

Rep: Reputation: 793Reputation: 793Reputation: 793Reputation: 793Reputation: 793Reputation: 793Reputation: 793
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: 1,004

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: 20,107

Rep: Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382Reputation: 3382
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 (current), FreeBSD, Win10, It varies
Posts: 9,951

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

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:38 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration