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 created a user on OS X Mavericks – dscl . -create /Users/newuser UserShell /bin/sh – without setting any password. This is confirmed by reading the user file with the dscl interactive prompt.
However, when I sudo su newuser and try to su back to root, bash prompts me for a password. I need to close the terminal and open a new window to exit the user session.
Why is that?
When you run sudo su newuser, you are effectively running as "newuser". Running su as "newuser" will require escalating to root, requiring a password.
Try just exiting the the original su session with exit or <ctrl-d>. This should return you to the original shell.
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 6 years ago.
Improve this question
I have Bash Ubuntu on Windows 10. This is enabled by turning on the Developer mode feature so the normal non-programmer would likely not need this. I need to reset the password. I must have typed it wrong (twice, somehow) when I first set it up. How can I do that?
This has been answered HERE
Copying from their answer:
In Windows command prompt change the default user to root:
lxrun /setdefaultuser root
Now Bash on Ubuntu on Windows logs you in as root without asking password
Use passwd command in Bash to change the user password:
passwd your_username
Change the default user back to your normal user in Windows command prompt
lxrun /setdefaultuser your_username
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
Recently updated to Windows 10, installed Ubuntu Bash. Wanted to start configuring, But I have hit a wall already.
When installed, you are asked for a username and password for your account.
This creates a user level.
Is it possible to access to root user, SU?
Every time I try, it asks for a password, and none of the accounts on the PC work (i.e., Windows 10 admin account password does not work). Tried default passwords too etc., all fail.
The reason for it is when looking at the users home directory: When creating a file, it creates it under my Windows User Account (Permissions).
But when I view files created from Bash, they are created for Root user.
So this is the confusion, I modified bashrc and it's no longer owned by root, So it's not accessible.
But I cannot login to root to create or modify the files.
Am I being a complete noob or something?
When bashrc is not owned by Root, when loading Bash.exe, I get .bashrc Input/output error.
as far as i know you'll have to type "sudo su"
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 want to create alias to reboot computer. Tried to set alias reboot='sudo reboot'. But it required to enter password. I want to know is that possible to put the password into this alias.
No, you can not put the password in the alias. sudo prevents this because it's a huge security hole.
Instead, run sudo visudo and add the line
yourusernamehere ALL=(ALL) NOPASSWD: /sbin/reboot
then your current alias will stop asking for a password and just allow the reboot.
You can create an alias like this
alias odo2='echo ROOT_PASSWD | sudo -S reboot'
Even better put all your aliases inside
~/.bash_profile
[This #2 would work if your have not changed your terminal login preferences to a different shell... Most probably your login shell would load up bash]
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've finally got to the point where I can successfully SSH into my server, but commands like 'rake' and 'bundle' don't work! I'd rather be taken to cmd than bash upon login. Is there a command I can put into PuTTY's "Remote Command" box so that cmd gets loaded? I tried "-c cmd" but it just closes upon a successful connection. If I leave it out and just type 'cmd' when the bash prompt is ready it works ok. Also another thing of note is that user environment variables in Windows don't get transferred to the SSH session (like GIT_SSH).
Nothing was working, but I came across something which sort of made sense when browsing the passwd file for another problem I was having. The last part of the line indicates what is executed upon login. Originally it was /bin/bash, so I changed it to the cmd executable and it works now.
ex)
Administrator:unused:[SID-STUFF]:U-POS-SERVER\Administrator,[SID-HERE]:/cygdrive/c/Users/Administrator:/cygdrive/c/windows/system32/cmd
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 9 years ago.
Improve this question
When I run sudo su on my mac os x (10.8.5) MacBook Air, the shell changes for some reason:
bos-mp2o6:~ rabdelaz$ sudo su
Password:
sh-3.2#
What's up with that?
The only thing I've done is install Heroku Toolbelt and, after getting sudo: unable to cache user root, already exists, rebooting.
When you use sudo su, it runs the superuser's .bashrc, so you get its prompt instead of your own.