Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Ubuntu bash terminal

  1. #1
    Join Date
    Dec 2020
    Beans
    1

    Ubuntu bash terminal

    Hi. I started with linux on a raspberry pi. I'm used to the way how the commands and privileges are setup on the pi.
    I was wondering if there is a way to make it the same on ubuntu.

    For example using sudo commands is a bit "weird" in my opinion. on ubuntu the experience feels more complex as it needs to be?

  2. #2
    Join Date
    Jun 2014
    Beans
    7,376

    Re: Ubuntu bash terminal

    Never having used a raspberry pi, I'm not sure what you are referring to in the use of commands. What OS did you have on the raspberri pi? Many Linux systems use sudo by default but many do not. What specifically do you mean by "more complex"?
    Last edited by yancek; December 21st, 2020 at 09:15 PM.

  3. #3
    Join Date
    May 2008
    Beans
    3,979
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Ubuntu bash terminal

    Quote Originally Posted by kubasmyk View Post
    Hi. I started with linux on a raspberry pi. I'm used to the way how the commands and privileges are setup on the pi.
    If you can elaborate, how are the commands and privileges set up on the pi?

  4. #4
    Join Date
    Mar 2011
    Location
    19th Hole
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Ubuntu bash terminal

    Welcome to the forums, kubasmyk.

    I use a Pi and have three set up around my house.

    For the benefit of those forum members who have already posted trying to help: there is no significant difference between Pi OS (neé Raspbian) and Ubuntu. The file structures and directory trees are practically identical. Ownership/privileges and commands are likewise identical since they adhere to the same defaults and conventions as are extant for all 'nixes.

    @OP

    sudo is a safer alternative to the old Unix tool su. By way of a simple explanation I will cite what I feel to be its primary advantage: The principle behind sudo is that the user is always operating as an ordinary user and only elevates into superuser status for brief, isolated periods for the purpose of executing one or a handful of commands. Since such privilege escalation also times out after a short period, there is far less danger of the user doing irreparable damage to his installation through forgetfulness. su doesn't provide such a backstop. Using su, I have messed up my system by making changes in my root account when I thought I was in my ordinary user account. I've never made that mistake using sudo. Hence, it is safer for newbies and power users alike.

    I recommend that you read the links in my sig: Linux is Not Windows and Resources for Newcomers. These explain why the separation between ordinary user and super user is so important. Though I don't want to jump to conclusions, given how you phrased your first post, you may still be using bad Windows habits in Linux and doing far too much while logged in as root.

  5. #5
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Ubuntu bash terminal

    I recently installed Debian out of curiosity. I had to set up an Administrator name and password was well as a User name and password. This means that to do administrator tasks I have to log out as an ordinary user and log in as administrator and then when I am finished I have to log out as administrator and log back in a ordinary user.

    Do you know what will happen if I do not log out as administrator? If I walk away from the machine anybody could use the machine with administrator privileges. Thankfully with Debian it is possible to not set an administrator name and password and then sudo will come into play.

    I much prefer the sudo method that has become the default in Ubuntu. It is much safer. And in case anybody is wondering. It is possible in Ubuntu to set up a user without sudo privileges. So, I think with Ubuntu we get the best out both methods.

    Regards
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Ubuntu bash terminal

    Quote Originally Posted by grahammechanical View Post
    I recently installed Debian out of curiosity. I had to set up an Administrator name and password was well as a User name and password. This means that to do administrator tasks I have to log out as an ordinary user and log in as administrator and then when I am finished I have to log out as administrator and log back in a ordinary user.
    You know you can just change to the other userid in a terminal if you know the name and password for that userid, right?
    Or you can use sudo to change to the other userid, if you prefer. Just use the available sudo options for that.

    All standard Unix stuff.

    I have multiple r-pis and haven't noticed any difference in how they handle accounts or sudo between the Pi and amd64 installs. What does the OP think is different? I'm confused.

  7. #7
    Join Date
    May 2010
    Beans
    3,242

    Re: Ubuntu bash terminal

    You can even run commands as the other user whilst logged in as any other user, as long as you have the password
    Code:
    su - parsnip -c "echo $HOME"
    will output
    Code:
    /home/parsnip
    Wheras running:
    Code:
    echo $HOME
    will output
    Code:
    /home/admin
    (Assuming you ran the commands as the "admin" user). You don't have to log off and back on. Linux is a true multiuser OS

  8. #8
    Join Date
    Jun 2014
    Beans
    7,376

    Re: Ubuntu bash terminal

    This means that to do administrator tasks I have to log out as an ordinary user and log in as administrator and then when I am finished I have to log out as administrator and log back in a ordinary user.
    To switch to root in a non-sudo system you simply open a terminal and type su or su -i and proceed to your task, then to switch back to normal user: su username. No reason to log out unless a user is limited to using a gui.
    The link below discusses the pros and cons of sudo, basically a matter of choice and for some, using what they are more familiar with.


    https://help.ubuntu.com/community/RootSudo

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Ubuntu bash terminal

    Quote Originally Posted by yancek View Post
    To switch to root in a non-sudo system you simply open a terminal and type su or su -i and proceed to your task, then to switch back to normal user: su username. No reason to log out unless a user is limited to using a gui.
    Not really the best way.

    su - joe # prompts for joe's password, if entered correctly, that session will **be** joe with joe's environment, especially HOME
    su joe # prompts for joe's password, if entered correctly, that session will only change the effective userid, but retain the prior userid's environment

    When done, just exit or <cntl>-d once to close the session and go back to the prior userid's environment. I've left out 'root' stuff on purpose.

    Basic Unix su stuff usually taught by day 3 of a 5 day Beginning Unix course. Opening deeper shell levels isn't usually necessary and can easily lead people into confusion.

  10. #10
    Join Date
    Jun 2014
    Beans
    7,376

    Re: Ubuntu bash terminal

    My earlier post may have been a misunderstanding on my part of the "logout and login" statement which of course is not necessary with either su or sudo . It's a matter of choice and familiarity in my opinion. Both have advantages and disadvantages and the link I posted earlier explains them fairly well.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •