Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
On my machine i'm getting "root#umar" that I want to change to "root#junaid". I have tried running different commands. They do change my username but above mentioned name is not changing.
See in above image. User I'm logged in as is "Junaid". But before that there is "root#umar" that I want to be changed to "root#junaid". Solutions I have tried change my current username that I'm loggedIn as.
Any solution?
"umar" is the hostname. So you should change it to get prompt like "root#junaid"
To do this on the fly you should exec next command:
sudo hostname junaid
sudo vi /etc/hostname
(to update the hostname there)
and the same in hosts file
sudo vi /etc/hosts
If you run commands as root you do not need to have sudo
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I need to restart the Nginx service without a password attempt.
I find out there is a way with sudoers. so I add blow command in sudoers but it's not working. I have ubuntu 19.4.
anonymous ALL=(ALL:ALL) NOPASSWD: /usr/sbin/systemctl restart nginx
so sudo systemctl restart nginx must work without any password attempt.
Look for sudo events in /var/log/auth.log.
Confirm that systemctl is in fact at /usr/sbin/systemctl (it may be in /bin/systemctl).
Ensure that you are running as user anonymous on this system for the above sudoers to work.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
How can I configure Linux to see the prompt for the root password if Sam try to execute the following command: $ sudo mkdir /opt/test?
If Sam is part of sudoers, the terminal ask for the user password not for the root password.
In /etc/sudoers, add this line:
Defaults rootpw
Make sure you use visudo for editing this file. For more information, you can check the link
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
When I try to change user to root, I get below error
➜ ~ su
Password:
Cannot execute /usr/local/bin/fish: No such file or directory
Any idea how do I get rid of this? I do not have fish installed now. I had installed it earlier.
I did the following and it worked for me.
Did "sudo bash" and got logged in as root. Was not able to login as root using normal "su" as it was throwing the error related to fish.
Deleted all traces of fish and zsh
logged out and logged in with my normal user name. Now , the default shell bash is working fine.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am trying to change a machine name for one of my CentOS servers. How would one go about changing it from saying:
user#XXXXXX (where I want to change what the XXXXX is)
Also if I change what the XXXXX is will someone be able to take the IP address of the server and figure out the new XXXXX?
Thanks.
Use the hostname command to change the hostname for the current session (it'll revert after you reboot) and edit /etc/hostname to change it permanently. You'll want to use both for the best results, as editing /etc/hostname doesn't change anything until you reboot.
E.g:
hostname newhost.example
echo "newhost.example" > /etc/hostname
These both need to be run as the root user.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I logged into my account on Bluehost using SSH and I got an unusual prompt.
I expected it to show the directory and a typical prompt but instead got some bash.
What you're seeing is the default bash prompt. This is what you get when the distro doesn't provide a better one in /etc/profile or similar. You can get it on any platform by ignoring the environment and config files:
env -i bash --norc
To get the user#host:dir$ prompt that Debian and derived distros use, you can add
export PS1='\u#\h:\w\$ '
to your .bash_profile