I'm trying to learn bash shell scripting, and I've run into a series of related issues. I can't execute the
script in
this Wikibook course, leading to this sequence of issues:
Code:
[austin@archlinux bash]$ ./mkfile.sh filetocreatetext.txt 'line to put in file'
bash: ./mkfile.sh: /home/austin/bash: bad interpreter: Permission denied
[austin@archlinux bash]$ chmod +x mkfile.sh
[austin@archlinux bash]$ ./mkfile.sh filetocreatetext.txt 'line to put in file'
bash: ./mkfile.sh: /home/austin/bash: bad interpreter: Permission denied
[austin@archlinux bash]$ sudo chmod +x mkfile.sh
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
[austin@archlinux bash]$ bash for3.sh
bash: for3.sh: No such file or directory
[austin@archlinux bash]$ bash for_2.sh
1
3
5
7
9
11
[austin@archlinux bash]$ sudo chmod +x mkfile.sh
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
[austin@archlinux bash]$ sudo pkexec chmod 4755 /usr/bin/sudo
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
[austin@archlinux bash]$ sudo --help
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
[austin@archlinux bash]$ man sudo
[austin@archlinux bash]$ chmod +x mkfile.sh
[austin@archlinux bash]$ emacs mkfile.sh
[austin@archlinux bash]$ ./mkfile.sh file-to-create.txt line to put in file
bash: ./mkfile.sh: /home/austin/bash: bad interpreter: Permission denied
Though I was extremely weary of trying the solution
here because of the dangers of working as root with
, I couldn't find any other obvious alternatives that didn't require logging in as root online.
Quote:
austin@archlinux bash]$ su
Password:
su: Authentication failure
[austin@archlinux bash]$ su
Password:
su: Authentication failure
[austin@archlinux bash]$ sudo -i
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
[austin@archlinux bash]$ su austin
Password:
su: Authentication service cannot retrieve authentication info
[austin@archlinux bash]$ sudo -s
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
|
I know I must have the correct root password, because I used it to put myself in the sudoers file when I installed my Arch system. I'm not very experienced, so I'm very hesitant to try this solution using
from AskUbuntu (plus, I'm obviously not running Ubuntu or even a Debian-based distro.)
Would it even be possible to reset my root password using
? I'm pretty sure my password is correct, if nothing else because it's identical to my regular user (e.g.
) password. (Yes, I know that's insecure and probably foolish, but I am where I am now; I don't intend to do it again.)