[go: up one dir, main page]

0% found this document useful (0 votes)
269 views1 page

NDG Linux Unhatched - NDG Linux Unhatched

The document discusses the su command in Linux, which allows a user to temporarily act as a different user. It explains that by default, running su without specifying a username will open a shell as the root user, providing administrative privileges. Finally, it notes that using the - or -l flags when running su is recommended, as it will fully configure the new shell with the settings of the target user by making it a login shell.

Uploaded by

Cavad İbrahimli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
269 views1 page

NDG Linux Unhatched - NDG Linux Unhatched

The document discusses the su command in Linux, which allows a user to temporarily act as a different user. It explains that by default, running su without specifying a username will open a shell as the root user, providing administrative privileges. Finally, it notes that using the - or -l flags when running su is recommended, as it will fully configure the new shell with the settings of the target user by making it a login shell.

Uploaded by

Cavad İbrahimli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

NDG Linux Unhatched - NDG Linux Unhatched  Share  Help

Content Objectives  Ubuntu PC


5
6 Administrative Access What is it?  It's an elephant being eaten by a snake, of course.                
sysadmin@localhost:~$ aptitude -vvvvvvvvvvvvvvvvvvvvvvvvvv moo                  
7 What is it?  It's an elephant being eaten by a snake, of course.                
8
There are many Linux commands which deal with sensitive information like sysadmin@localhost:~$ pwd                                                       
passwords, system hardware, or otherwise operate under other exceptional /home/sysadmin                                                                  
9 sysadmin@localhost:~$ cd Documents/                                             
circumstances. Preventing regular users from executing these commands helps sysadmin@localhost:~/Documents$                                                 
10
to protect the system. Logging in as the root user provides administrative sysadmin@localhost:~/Documents$                                                 
11 sysadmin@localhost:~/Documents$ pwd                                             
access, allowing for the execution of some of the privileged commands.
11.1 /home/sysadmin/Documents                                                        
sysadmin@localhost:~/Documents$ cd ..                                           
12 The su Command sysadmin@localhost:~$ ls                                                        
13 Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos       
sysadmin@localhost:~$ ls -l -s                                                  
14 su OPTIONS USERNAME total 32                                                                        
14.1 4 drwx------ 2 sysadmin sysadmin 4096 Dec 20  2017 Desktop                      
4 drwx------ 4 sysadmin sysadmin 4096 Dec 20  2017 Documents                    
14.2 The su command allows you to temporarily act as a different user. It does this 4 drwx------ 2 sysadmin sysadmin 4096 Dec 20  2017 Downloads                    
15 by creating a new shell. The shell is simply a text input console that lets you 4 drwx------ 2 sysadmin sysadmin 4096 Dec 20  2017 Music                        
4 drwx------ 2 sysadmin sysadmin 4096 Dec 20  2017 Pictures                     
16 type in commands. By default, if a user account is not specified, the su 4 drwx------ 2 sysadmin sysadmin 4096 Dec 20  2017 Public                       
17 command will open a new shell as the root user, which provides administrative 4 drwx------ 2 sysadmin sysadmin 4096 Dec 20  2017 Templates                    
4 drwx------ 2 sysadmin sysadmin 4096 Dec 20  2017 Videos                       
18 privileges.
sysadmin@localhost:~$                                                           
19
20 Follow Along
21 Utilizing the login shell option is recommended, as the login shell fully
22 configures the new shell with the settings of the new user. This option can
22.1 be specified one of three ways:
⌨ Toggle onscreen keyboard
su -
su -l

You might also like