Mac OS X: Delete my User, or "Current User" [closed] - macos

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 1 year ago.
Improve this question
I have a MacBook Air (with OS X El Capitan Version 10.11.5) that is shared by other users.
I have admin privileges.
I want to delete my "User", however, I cannot do such within "System Preference > Users & Groups", because I can delete "Other Users" but not myself as "Current User".
How can I delete my "User" without affecting "Other Users"?

I am not sure about my answer but I think you cannot delete user which is logged in. So you should have logged in by another Admin account and remove yours. And If you have not access to other Admin accounts, create another admin user and delete your user when you logged in at new account

open Terminal and type the following commands, or create .sh file and add them there:
echo "YourPassword" | sudo -S rm -R /Users/YourUser
sudo rm /private/var/db/.AppleSetupDone
sudo dscl . -delete /Groups/YourUser
sudo dscl . -delete /Users/YourUser
Where YourUser could be any user you have already logged in, and "Your Password" (with quotes) is the same password you use to log in your mac.

Related

How to open putty using batch and login then execute list of commands on bash [closed]

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 a Sun OS server with oracle configured on it ; with database 11g i want to take backup , now am connecting to terminal using ssh on putty console but , what i need is finding a way to make it possible to connect using batch to ssh to the server then login then login to oracle then take the backup, is that possible and how.
If you really want to use putty to do this you can use the below in your command prompt in Windows(this will open the putty and its terminal and execute the passed argument in you text file):
putty.exe plink -ssh -load profileName -l username -pw password -m commandPath -t
Or
putty.exe -ssh username#ip -pw password -m commandPath
e.g:
putty.exe -ssh rootz#10.10.10.10 -pw rootzpass -m c:\commands\mycommands.txt
Where profileName is the profile saved in putty and the commandPath is your local directory text file containing the commands you want to execute and the username is the server user and ip is the IP address for the server , the password is your server password then you can put whatever commands you want in your textFile.
Reference
the.earth putty documentation

How can I transfer a file after having already logged in to a server via ssh? [closed]

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
This is a rather odd and embarrassing situation for all involved.
Suppose someone (cough cough not me cough cough) accidentally chmod 000d my home directory on a remote server.
I had been using ssh keys to login, since I figured I would forget the actual password on the remote host (which I have). However, now that my home directory has 000 perms, the ssh key in ~/.ssh/authorized_keys is unreadable, and ssh forces me to put in a password that I have long since forgotten.
Also, I don't have sudo superpowers on the remote server.
HOWEVER, I happen to have an ssh session open to the remote server that started before someone (cough) chmod 000d my home directory.
All of this happened while I was trying to upload some files from my local host to a publicly accessible directory in my home directory.
CAN I STILL UPLOAD FILES FROM MY LOCAL MACHINE TO THE REMOTE MACHINE WITHOUT NEEDING A NEW SSH SESSION?!
I figure I could at least put them in /tmp or something for now.
Yes you can!
Press enter,~,Shift+C to open a ssh command line.
Enter -L 12345:localhost:12345 to forward a new port over your existing SSH connection
Run nc -l -p 12345 | tar xzv on your remote ssh session
Run tar czv FileOrDir1 FileOrDir2 Etc | nc localhost 12345 on your local system.
The files will now transfer over your existing ssh connection, and will appear in the current dir of your remote session.
Why you would want to do this instead of just chmod 711 ~ is beyond me though.

Windows public ssh key on remote linux [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have public ssh key created on Windows 7 and I want to install it on remote Debian. How to do it?
This question here is off-topic and will probably be moved to http://serverfault.com.
However, copy your public key to the remote debian system with scp (I don't have a Windows machine, so I will give you Linux instruction, try to understand them and modify them according to your operative system):
scp /path/to/public/key.pub user#debian-server:~/.ssh/key.pub
It will ask your password to log in, then it will copy the key and log out.
Log in again in your machine with ssh and do the following:
ssh user#debian-server
chmod 700 .ssh
cd .ssh
cat key.pub >> authorized_keys
chmod 600 authorized_keys
exit
Now, you should be able to log in remotely without issuing your password, providing that RSA authentication method is enabled in sshd_config on the debian server.
Note: the chmod part is not worldwide required, but sometimes wrong permission on files and folder will prevent you to correctly login.
You have to store your public key into .ssh/authorized_keys on your debian machine.
You will find the .ssh folder in your home directory if openssh-server is installed.

Change user password in samba server with the pdbedit tool [closed]

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 user password with script but I'm having trouble using the -t option. Here's what I try:
echo -e "12345\n12345\n" | pdbedit -t -u username
So this is wrong somehow. Any ideas what I am missing or what should I try?
$ printf "%s\n%s\n" pwd pwd|pdbedit -t -r -u user
does not appear to work either
According to http://git.samba.org/?p=samba.git;a=blob;f=source3/utils/pdbedit.c
the --password-from-stdin parameter (pw_from_stdin) only affects account creation.
Thus, you'll rather prefer smbpasswd
$ printf "%s\n%s\n" pwd pwd|smbpasswd -s user
( Piping password to smbpasswd )

Here Document not working with sudo su [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I was trying to write a setup.sh script that searches and installs the required components while installing an application. If a required component is not found it will prompt to install it. I have used sudo apt-get install for that, and I want to pass the user supplied password to sudo, like this:
read passwd
sudo apt-get install clisp <<EOF
$passwd
$passwd
EOF
But this is not working. The input password is not being passed to sudo. Why is this not happening? Is there any mistake in my usage?
The password is not read from the standard input but from the "current terminal". This is not changeable via redirection. But sudo provides an optione -S which read the password from standard input and not from the terminal.
Edit: A better solution to the whole problem would be to avoid intercepting the password at all. sudo will ask for the password itself if it requires one. using the -A option you can also provide a graphical UI for this question. And since sudo keeps a timestamp for that input it will not ask for the password the next 15 minutes (by default, i.e. configurable). Therefore multiple sudo calls are also not a problem.

Resources