Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
SSHKit extension, for sudo operation with password input.
Add this line to your application's Gemfile:
gem 'sshkit-sudo'
And then execute:
$ bundle
If you're using Capistrano, add the following to your Capfile:
require 'sshkit/sudo'
This gem adds sudo
and execute!
command to SSHKit backends.
To execute a command with sudo, call sudo
instead of execute
.
sudo :cp, '~/something', '/something'
# Or as follows:
execute! :sudo, :cp, '~/something', '/something'
# Executing a command with sudo in Capistrano task
namespace :nginx do
desc 'Reload nginx'
task :reload do
on roles(:web), in: :sequence do
sudo :service, :nginx, :reload
end
end
desc 'Restart nginx'
task :restart do
on roles(:web), in: :sequence do
execute! :sudo, :service, :nginx, :restart
end
end
end
namespace :prov do
desc 'Install nginx'
task :nginx do
on roles(:web), in: :sequence do
within '/etc/apt' do
unless test :grep, '-Fxq', '"deb http://nginx.org/packages/debian/ wheezy nginx"', 'sources.list'
execute! :echo, '"deb http://nginx.org/packages/debian/ wheezy nginx"', '|', 'sudo tee -a sources.list'
execute! :echo, '"deb-src http://nginx.org/packages/debian/ wheezy nginx"', '|', 'sudo tee -a sources.list'
execute! :wget, '-q0 - http://nginx.org/keys/nginx_signing.key', '|', 'sudo apt-key add -'
sudo :'apt-get', :update
end
end
sudo :'apt-get', '-y install nginx'
end
end
end
Available in sshkit-sudo 0.1.0 and later.
If you are using a same password across all servers, you can skip inputting the password for the second server or after
by using use_same_password!
method in your deploy.rb
as follows:
class SSHKit::Sudo::InteractionHandler
use_same_password!
end
You can set your own matchers in your deploy.rb
as follows:
class SSHKit::Sudo::InteractionHandler
password_prompt_regexp /[Pp]assword.*:/
wrong_password_regexp /Sorry.*\stry\sagain/
end
You can write your own handler in your deploy.rb
as follows:
class SSHKit::Sudo::InteractionHandler
def on_data(command, stream_name, data, channel)
if data =~ wrong_password
SSHKit::Sudo.password_cache[password_cache_key(command.host)] = nil
end
if data =~ password_prompt
key = password_cache_key(command.host)
pass = SSHKit::Sudo.password_cache[key]
unless pass
print data
pass = $stdin.noecho(&:gets)
puts ''
SSHKit::Sudo.password_cache[key] = pass
end
channel.send_data(pass)
end
end
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that sshkit-sudo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.