If this account will be assigned to another system admin, you can force the user to change its password at the first log in attempt by issuing the following command. Follow the adduser prompt to setup the user details and password. Make sure you setup a strong password to protect this account. This new account will be granted with root powers privileges via sudo command and will be used to perform administrative tasks in the system. In order to create a new account on the system, log in to the system with the account user with root privileges and create a new account with the below command. $ sudo apt autoremoveĪutoremove APT Packages and Cache Create New Account in Ubuntuīy default, as a security measure, the root account is completely disabled in Ubuntu. In order to remove all locally downloaded deb packages and all other apt-get caches, execute the below command. $ sudo apt list -upgradableĪfter you’ve consulted the list of packages available for upgrading, issue the below command to start system upgrade process. $ sudo apt updateĪfter running the update command, you will see the number of available packages for upgrading process and the command used for listing the packages upgrades. To update Ubuntu server, to log in to server’s console with an account with root privileges or directly as root and run the below commands in order to perform the update and upgrade process. The first step you need to take care of in case of fresh installation of Ubuntu server or a new deployed Ubuntu VPS is to make sure the system and all system components, such as the kernel, the apt package manager and all other installed packages are up-to-date with the latest released versions and security patches. The configurations explained in this topic are almost the same for all Ubuntu server systems, regarding of the underlying OS platform, whether Ubuntu is installed on a bare-metal server, in a private virtual machine or a virtual machine spinned-out in a VPS public cloud. Note: You don't need any special options with SSH as the SSH server always creates a login shell to be accessed by the SSH client.This tutorial will guide you on the first basic steps you need to configure on a new installed Ubuntu server in order to increase security and reliability for your server. It works for localhost as well as for other hosts and provides public key authentication that works without any interactive input. If you want to run commands as a different user without performing authentication from the keyboard, you might want to use SSH instead. I noticed that you are using -S and I don't think it is generally a good technique. # strace -f -e process sudo -S -i -u user echo \$HOMEĮxecve("/usr/bin/sudo",, ) = 0 The output bellow shows that the shell is being called with -login and with the specified command, just as in your explicit call to bash, but in addition sudo can do its own work like setting the $HOME. I have just checked the last example with strace which tells you exactly what's happening. Note: The backslash character ensures that the dollar sign reaches the target user's shell and is not interpreted in the calling user's shell. When command is not specified you'll get a login shell prompt, otherwise you'll get the output of your command.Įxample (with a specified user): sudo -i -u userĮxample (with a command): sudo -i -u user whoamiĮxample (print user's $HOME): sudo -i -u user echo \$HOME To invoke a login shell using sudo just use -i.
0 Comments
Leave a Reply. |