You are not logged in.

#1 2010-08-24 10:42:29

AndersJ
Member
Registered: 2009-10-29
Posts: 11

visudo runs after every login

Hi all

I recently installed ArchBang but after an update, I guess, I have got a problem when I login.

I don't use a loginmanager, so I just login from the terminal. But every time when I have written my password, It asks for my password again and the open the sudoers file. So I have to quit it with :q before openbox appears. I don't have to change anything.

Does anyone know how to deal with this problem?

Kind Regards

Anders

Offline

#2 2010-08-24 13:40:52

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: visudo runs after every login

have you mistakenly put the visudo command in your .xinitrc ??


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2010-08-24 13:50:52

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: visudo runs after every login

Inxsible wrote:

have you mistakenly put the visudo command in your .xinitrc ??

Or perhaps created an alias in your .bashrc.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#4 2010-08-25 01:50:50

AndersJ
Member
Registered: 2009-10-29
Posts: 11

Re: visudo runs after every login

Can't find the visudo command in neither of the files.

Don't really understand why this problem suddenly began. Haven't run the visudo command at any time before it began..

Offline

#5 2010-08-25 09:05:22

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: visudo runs after every login

You haven't chained to commands/variables with the second one starting with "sudo"? If the first one uses $EDITOR or a command that calls an editor and the default is vi, then it could end up calling visudo. Though their locations are different so that probably wouldn't happen if the full path of vi was included.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#6 2010-08-25 09:31:17

AndersJ
Member
Registered: 2009-10-29
Posts: 11

Re: visudo runs after every login

I don't know have to do that, so I don't think that is it.. Can I check it some way??

I have changed my hostname recently, maybe that is when it started.. I have also recently got the problem that when I try to shutdown or halt my computer it always reboots, no matter how I try to shutdown. Don't know if it is related..?

ty for trying to help

Offline

#7 2010-08-25 09:40:45

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: visudo runs after every login

AndersJ wrote:

I don't know have to do that, so I don't think that is it.. Can I check it some way??


You could type 'env' and check the results (you may need to grep for visudo or pipe through more to see all the results).

AndersJ wrote:

I have changed my hostname recently, maybe that is when it started.. I have also recently got the problem that when I try to shutdown or halt my computer it always reboots, no matter how I try to shutdown. Don't know if it is related..?

ty for trying to help

Don't know, it's an odd enough problem. What steps did you go through to change your host name?


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#8 2010-08-25 09:46:53

AndersJ
Member
Registered: 2009-10-29
Posts: 11

Re: visudo runs after every login

No, nothing about vi, sudo or visudo when I type 'env'.

I just changed the hostname in the rc.conf and hosts.

Offline

#9 2010-08-25 09:49:27

AndersJ
Member
Registered: 2009-10-29
Posts: 11

Re: visudo runs after every login

Is there a way I can see when is written i tty1? It writes something just after I quit visudo, but can't manage to read it before it has scrolled up the screen..

Offline

#10 2010-08-25 10:15:18

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: visudo runs after every login

You could check the logs, /var/log/. Not sure which ones specifically, but I would start with auth.log, syslog.log and everything.log.

Did you check your .bash_profile?
Does your .bashrc source any other files, you should check those, too.

Does your sudoers file reference the old host name? See man sudoers for an exhaustive list of ways it can do that.
Can you run visudo manually in a terminal? You'll need to sudo it (which is why you have to write your password again).


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#11 2010-08-25 10:49:49

AndersJ
Member
Registered: 2009-10-29
Posts: 11

Re: visudo runs after every login

Found this in the auth.log:

Aug 25 21:21:02 HejArch login[4787]: pam_unix(login:session): session opened for user anders by LOGIN(uid=0)
Aug 25 21:21:07 HejArch sudo:   anders : TTY=tty1 ; PWD=/home/anders ; USER=root ; COMMAND=/usr/sbin/visudo

The only metioning I could find about visudo in the log, but guess it doesn't tell us much.

Nothing to find in the .bash_profile about visudo..

My hostname is not mentioned in my sudoers from what I can tell. This is what is in my sudoers (and some stuff above which is commented).
Only the last line are written by me, tried to fix the reboot/shutdown problem..

# User privilege specification
root    ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
# %wheel    ALL=(ALL) ALL

# Same thing without a password
# %wheel    ALL=(ALL) NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now
anders ALL=(ALL) ALL
anders ALL=(ALL) NOPASSWD:/usr/sbin/update-menus
anders ALL=(ALL) NOPASSWD:/usr/bin/oblogout
anders ALL=NOPASSWD: /sbin/shutdown -h now,/sbin/reboot

It is no problem to run visudo from a terminal, only odd thing is that if I don't write sudo in front it gives my permission denied twice..

[anders@HejArch ~]$ visudo
visudo: /etc/sudoers: Permission denied
visudo: /etc/sudoers: Permission denied

Don't know if this is normal?

Offline

#12 2010-08-25 11:05:09

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: visudo runs after every login

I think visudo is not able to recognize the "-h now" that you have in the file.

I just have /sbin/shutdown for my NOPASSWD.

Try changing this line

anders ALL=NOPASSWD: /sbin/shutdown -h now,/sbin/reboot

to

anders ALL=NOPASSWD: /sbin/shutdown, /sbin/reboot

Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#13 2010-08-25 11:13:02

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: visudo runs after every login

Yes, I think that's normal (I hope so as it happens to me) as I think there's two operations that requite authorisation (opening the file and creating the tmp file).

I'm a little stuck - the only thing I can think of is that some file referenced by your login files (.bashrc etc.) is making the call. Some config files are really just scripts, so you should check all of those too. You could narrow it down by putting echo statements into the files and seeing how many of those appear before visudo opens up. If they all vanish too quickly, putting a simple "read" statement after each one will mean that you have to hit enter for the process to move on.

This should narrow the search down a little bit.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#14 2010-08-25 11:15:17

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: visudo runs after every login

Inxsible wrote:

I think visudo is not able to recognize the "-h now" that you have in the file.

I just have /sbin/shutdown for my NOPASSWD.

Try changing this line

anders ALL=NOPASSWD: /sbin/shutdown -h now,/sbin/reboot

to

anders ALL=NOPASSWD: /sbin/shutdown, /sbin/reboot

Not sure that's the case, I have this as my entry

Cmnd_Alias SHUTDOWN=/sbin/shutdown -h now, /sbin/shutdown -r now, /sbin/reboot

The sudoers man page covers it and states that options have to be as typed in (you can wildcard options as well). Some chars need to escaped, but not - IIRC.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#15 2010-08-25 11:20:59

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: visudo runs after every login

Hmm... you learn something new everyday. so if you put in -h now, does that mean that all other options/switches of that command (shutdown in this case) will require a password ??


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#16 2010-08-25 12:29:11

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: visudo runs after every login

Inxsible wrote:

Hmm... you learn something new everyday. so if you put in -h now, does that mean that all other options/switches of that command (shutdown in this case) will require a password ??

As I understand it, yes. I've not tried though.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#17 2010-08-26 02:20:55

AndersJ
Member
Registered: 2009-10-29
Posts: 11

Re: visudo runs after every login

This is the content of my xinitrc:

#!/bin/bash
#xcompmgr -CcfF -I-.015 -O-.03 -D6 -t-1 -l-3 -r4.2 -o.5 &
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
    eval "$(dbus-launch --sh-syntax --exit-with-session)"
fi 
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
numlockx &
exec ck-launch-session openbox-session

and my bashrc:

[ -z "$PS1" ] && return
PS1='[\u@\h \W]\$ '
cat ~/.logo
echo
cal
alias ls='ls --color=auto'

I haven't really edited them except for the numlockx &..

I have sudoers.pacnew in the /etc folder, can that mess with anything??

Otherwise I guess a reinstall should fix it and maybe I will install Arch the proper way instead of taking a shortcut to openbox with ArchBang! smile

Offline

#18 2010-08-26 07:14:33

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: visudo runs after every login

You should definitely use the new sudoers file! A lot has changed in it! Best way imho is to save the old one as a backup and then rename sudoers.pacnew to sudoers. Then run visudo and edit it the way you want. Your options still remain available in the backup in case you need to look into it to do your options right.

But I don't think that this causes your problem.

Offline

#19 2010-08-26 09:47:18

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: visudo runs after every login

What Arny says, plus you could try the Archbang people, as they should know what else gets called at start-up - if anything is different (eg in the /etc/bash.bashrc file).
But I'd put those debug statements in all start-up files, just to narrow down the step that's doing it - might be less effort than a complete reinstall.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#20 2010-08-26 11:11:13

AndersJ
Member
Registered: 2009-10-29
Posts: 11

Re: visudo runs after every login

Yeah I tried the new sudoers file, but as Army predicted it didn't solve the problem.

Currently I "fixed" it by installing Xubuntu, needed the old version of Ruby for an assignment anyway:) When it is the lecturer who have made the libraries needed, there isn't really much to discuss:)

But thank you for the help, will return to Arch soon.

Offline

Board footer

Powered by FluxBB