I'm following this tutorial for deploying a node project on an EC2 instance.
I have to install npm and here what I have to do:
sudo su
vi /etc/sudoers
edit by pressing "i"
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
In order to save your changes, press ESC key and type “wq” and hit ENTER in VI editor.
But I can't because when I press "i" I got an error
W10: Warning: Changing a readonly file
How do I solve this?
So I think it was a bug from vi because I then try with nano and I had the right to write in the file.
For, node I try from the website but it wasn't working to, I think the problem come from amazon linux. I try with another instance with ubuntu server 14.04 and I had no problem
The second problem is that with vi, you have to use :w! to actually overwrite a read-only file, when you are root.
The first problem is that whoever wrote the tutorial is giving bad advice: /etc/sudoers is not supposed to be edited directly.
You are supposed to use visudo to edit that file, to avoid shooting yourself in the foot. Done the correct way, you should have no issues.
Related
Currently, I'm running vscode from the terminal with the following command:
sudo code --user-data-dir="~/.vscode-root"
(I'm using POP OS) However, how can I perhaps add it to PATH, so instead of the command above, I can issue the following command:
vscode
In order to always run it as root?
You can edit your 'visudo' file and add the full path to the application:
<YOURUSERID> ALL = NOPASSWD:<FULLPATHTOVSCODE>
But this is really a great way to do something bad. Sudo should be used rarely and if you are using it frequently there is a better way to do what you are doing.
I recently switched to Linux Mint 19.1.
While typing passwords in terminal it shows asterisks. How can I edit my sudoers file to disable them (not deleting but disabling)?
Just execute the script below:
sudo mv /etc/sudoers.d/0pwfeedback /etc/sudoers.d/0pwfeedback.disabled
The above line will disable the functionality of the 0pwfeedback package. Thus, the asterisks will be disappeared. Many solutions on the web are saying to delete it. Do not do that. In case you will need the asterisks back you will enable it again. This is how it must be done.
I am trying to make some changes in etc/environment file and when I am going to save the file it shows like this,
"you don't have the permissions necessary to save the file"
please help me how can I change the file permission in Ubuntu.
Thanks,
Abhilash
You need to open the file with command sudo at the beginning. You will be then prompted for the root password. After writing it, open editor will open, and you will be able to save file.
It depends on where you try to open the file. If are you terminal, you can run sudo nano /etc/environment (or any other editor, e.g. vim etc). You will need to enter the root password. The editor opens (in this case nano), make changes to it, then press Ctrl+O, press Enter, then Ctrl+X.
If you want to open it with gedit or any other GUI editor you need to install gksu: run in terminal sudo apt-get install gksu. You will asked for your root password, type it in and the application will be installed. Then you can run gedit in the terminal like this: gksudo gedit /etc/environment. Make the changes and press Save as in Windows Notepad.
I Installed Ubuntu 14-04 LTS. I tried to install software's using Terminal.Each time Software Installation successful but after installation it always diSlays one command which is '-System-Product-Name:~$ '.I applied many this like my computer name etc.But not yet success.
I am new in Linux platform.Anyone aware solution for the same please help me.Thanks In advance
Add the following line to .bashrc file in your /home/your-username folder
export PS1="\[\e[0;32m\]\u#\h:\e[m\] \[\e[1;34m\]\w$\e[0m "
execute the command
source .bashrc
Then read
http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
System-Product-Name is the default hostname.
To change it, you can run sudo nano /etc/hostname, modify it with something like yourname-desktop
I'm on a fresh Virtualbox install of CentOS 6.4.
After installing zsh 5.0.2 from source using ./configure --prefix=/usr && make && make install and setting it as the shell with chsh -s /usr/bin/zsh, everything is good.
Then some time after, after installing python it seems, it starts acting strange.
Happens with PuTTY and iTerm2 over SSH, does not happen on the raw terminal through Virtualbox.
typing something, then erasing it: rather than removing the char and moving the cursor back, the cursor moves forward.
Typing Ctrl+V then Backspace repeatedly prints out this repeating pattern '^#?'
Running cat from zsh works fine. Prints out '^H' if I type that, backspaces like normal if I type normal backspace.
Surely someone's seen this before and knows exactly what the hell it is.
I'm not positive yet, but it seems that installing oh-my-zsh can fix this. But I really want to know what the specific issue is here.
OK , I suggest you try
export TERM=xterm
in your .zshrc configuration
the Changing into Zsh caused the bug.
sigh I knew I solved this before.
It's too damn easy to forget things.
The solution is to compile and apply the proper terminfo data with tic, as I have a custom config with my terminal clients, xterm-256color-italic, that confuses zsh.
There appear to be other ways to configure this stuff too; I basically just need it to be properly set up so italics work everywhere (including in tmux) so hopefully I can figure out how to do this more portably than I am currently.
I encounter the same problem when I manually install ZSH without root, when the backspace turns to blankspace but still functions as Backspace. Finally, I find it is because "ncurses" is not installed well.
tic: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory
? tic could not build /home/user/ceph-data/soft/ncurses-6.1/share/terminfo
After I reinstall the "ncurses", the problem of ZSH backspace is solved. Just for your information.
my $TERM is xterm-256color, by the way.