Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
replaced http://serverfault.com/ with https://serverfault.com/
Source Link

You can ssh in using key-based only authentication, and then edit the sudoers file not to require a password. This will eliminate the password at the two steps you described.

To see up ssh key based ssh access:

ssh-keygen ssh-copy-id dest-server 

And the for the sudoers file:

sudo visudo -f /etc/sudoers #uncomment the following and then add yourself to the sudo group # %sudo ALL=NOPASSWD: ALL 

Better would be to require no password for sudo only for the commands you need to automate this particular function. See my answer herehere for that.

References:
Setting up a user without a passwordSetting up a user without a password

How do you setup ssh to authenticate using keys instead of a username / password?How do you setup ssh to authenticate using keys instead of a username / password?

You can ssh in using key-based only authentication, and then edit the sudoers file not to require a password. This will eliminate the password at the two steps you described.

To see up ssh key based ssh access:

ssh-keygen ssh-copy-id dest-server 

And the for the sudoers file:

sudo visudo -f /etc/sudoers #uncomment the following and then add yourself to the sudo group # %sudo ALL=NOPASSWD: ALL 

Better would be to require no password for sudo only for the commands you need to automate this particular function. See my answer here for that.

References:
Setting up a user without a password

How do you setup ssh to authenticate using keys instead of a username / password?

You can ssh in using key-based only authentication, and then edit the sudoers file not to require a password. This will eliminate the password at the two steps you described.

To see up ssh key based ssh access:

ssh-keygen ssh-copy-id dest-server 

And the for the sudoers file:

sudo visudo -f /etc/sudoers #uncomment the following and then add yourself to the sudo group # %sudo ALL=NOPASSWD: ALL 

Better would be to require no password for sudo only for the commands you need to automate this particular function. See my answer here for that.

References:
Setting up a user without a password

How do you setup ssh to authenticate using keys instead of a username / password?

added 249 characters in body
Source Link
Kyle Brandt
  • 85.9k
  • 77
  • 318
  • 463

You can ssh in using key-based only authentication, and then edit the sudoers file not to require a password. This will eliminate the password at the two steps you described.

To see up ssh key based ssh access:

ssh-keygen ssh-copy-id dest-server 

And the for the sudoers file:

sudo visudo -f /etc/sudoers #uncomment the following and then add yourself to the sudo group # %sudo ALL=NOPASSWD: ALL 

Better would be to require no password for sudo only for the commands you need to automate this particular function. See my answer here for that.

References:
Setting up a user without a password

How do you setup ssh to authenticate using keys instead of a username / password?

You can ssh in using key-based only authentication, and then edit the sudoers file not to require a password. This will eliminate the password at the two steps you described.

To see up ssh key based ssh access:

ssh-keygen ssh-copy-id dest-server 

And the for the sudoers file:

sudo visudo -f /etc/sudoers #uncomment the following and then add yourself to the sudo group # %sudo ALL=NOPASSWD: ALL 

References:
Setting up a user without a password

How do you setup ssh to authenticate using keys instead of a username / password?

You can ssh in using key-based only authentication, and then edit the sudoers file not to require a password. This will eliminate the password at the two steps you described.

To see up ssh key based ssh access:

ssh-keygen ssh-copy-id dest-server 

And the for the sudoers file:

sudo visudo -f /etc/sudoers #uncomment the following and then add yourself to the sudo group # %sudo ALL=NOPASSWD: ALL 

Better would be to require no password for sudo only for the commands you need to automate this particular function. See my answer here for that.

References:
Setting up a user without a password

How do you setup ssh to authenticate using keys instead of a username / password?

Source Link
Kyle Brandt
  • 85.9k
  • 77
  • 318
  • 463

You can ssh in using key-based only authentication, and then edit the sudoers file not to require a password. This will eliminate the password at the two steps you described.

To see up ssh key based ssh access:

ssh-keygen ssh-copy-id dest-server 

And the for the sudoers file:

sudo visudo -f /etc/sudoers #uncomment the following and then add yourself to the sudo group # %sudo ALL=NOPASSWD: ALL 

References:
Setting up a user without a password

How do you setup ssh to authenticate using keys instead of a username / password?