Brain teaser,
I was given the task below.
Can someone please explain to me how chef works? That is a pretty broad question, so to narrow it down I have this very simple recipe that loops over a list of users and creates each one if they do not already exist. It does not work.
Hello,
I am not sure, where I am missing in the scirpt, I am trying to grep few users from /etc/passwd file and if exists, I added line to echo as user exist, if not create it.
Code:
#!/bin/bash
for vid in v707 z307 z496 z163 z292 ; do
if [ grep "$vid" /etc/passwd ]
then
echo " $vid User exists "
else
Here I have user and group with same name, while adding user(mqm) to the group(mqm) I am getting following problem. please give me solution.
[root@localhost /]# useradd -G mqm mqm
useradd: user 'mqm' already exist
Hello Everyone, I am some what new to Fedora, but I do know my way around pretty good. I am currently taking a Linux (Fedora) class in college. This week was all about programming and scripting. I personally hate programming but its one of those things that is good to know.... anyways so here is my problem. I have to write a script to include the following:
I get an "rejected acces to DIR for user USER" message, when I try an "cvs login" to my local cvs... BUT everything works just fine, when cvs is set to run as root...
How to login with non ec2-user account in amazon linux ami?
#useradd -m sample
#passwd sample
set password
#cat /etc/passwd
sample:x:508:1002::/home/monitor/sample:/bin/bash
# cat /home/monitor/sample/.ssh/authorized_keys
command="echo 'Please login as the ec2-user user rather than root
user.';echo;sleep10" ssh-rsa xxxxxxxxx
# chown -R sample /home/monitor/sample/.ssh
I copied /root/.ssh/
I manually edited /etc/passwd for non-root user - yeah, I know this is bad.
Unfortunately I saw this (SSH failing authentication after manual edit of /etc/passwd and /etc/shadow) very late.
I already recovered /etc/passwd to previous state, but something strange is happening on the server, for example:
useradd some_user
doesn't create home directory for this user, and doesn't ask about it passw
How might I use script /usr/bin/su-to-root after I have intentionally locked the root account?
Running Debian GNU/Linux 6.0.5 "squeeze" and noticed menu item "System > Administration > Synaptic Package Manager" has default command:
su-to-root -X -c /usr/sbin/synaptic
which fails even though I provide the correct root password.