The user is not in the sudoers file. This incident is being reported. cover deployment: customization

New update Flag - port number -p but I cannot log in root, received (publickey, permission denied)

I subscribe to vps in the digital ocean.

This tutorial is currently undergoing https://coderwall.com/p/yz8cha , and this railscast http://railscasts.com/episodes/335-deploying-to-a-vps

I made a new user inside vps, but this user does not have sudo priveledge

when I do the deployment closure: setting according to the manual I get this

 judy is not in the sudoers file. This incident will be reported. failed: "sh -c 'sudo -p '\\''sudo password: '\\'' ln -nfs /home/judy/apps/lintong/current/config/nginx.conf /etc/nginx/sites-enabled/lintong'" on 192.241.241.204 

I changed the port to 888 according to the manual, and now I can not ssh to the server

when i do ssh root@ipaddress or ssh judy@ipaddress

trying to connect to port 22

The first question is how can I pass to the field when I ssh in vps with the option of port 888?

Second question How can I give the rights of a judge sudo? according to the coderwall tutorial i have to do this

 visudo 

then

add username ALL=(ALL:ALL) ALL , but I think I did it before and it didn't work?

+6
source share
3 answers

For the latest versions of Ubuntu / Debian, do not change /etc/sudoers , but add the user to the sudo group in /etc/group .

sudo usermod -a -G sudo judy

or

sudo vigr (and sudo vigr -s )

To use ssh with a specific port, use -p 888 : ie, ssh -p 888 judy@ipaddress

(Note that if you ever need to install a port using scp, use -P instead.)

+12
source

Answering only one question:

 ssh -p 888 root@ipaddress 

should allow you to log in when ssh is listening on port 888 . Not sure what is wrong with the second part ... can you show the judy entry from /etc/sudoers ?

+1
source

For ssh for another port:

 ssh -p 888 root@ipaddress 

To get the right to participate in Judy sudo, it is somewhat dependent on the OS for good practice. In Ubuntu, you can simply add Judy to the admin group.

 useradd -G admin judy 

This is because there is already an entry that displays this group in the sudoers file for Ubuntu servers.

+1
source

Source: https://habr.com/ru/post/953192/


All Articles