A informação, cada vez mais, é o bem mais valioso que temos, e pensando no lado da tecnologia, informação é algo muito mais valioso. Nós temos geralmente temos “preguiça” de realizar determinadas tarefas e dependendo da tarefa a ser realizada é desejável que seja automatizada. Já temos milhões de coisas para lembrar e realizar, quanto menos coisas dependerem de nós, humanos, para ter controle, creio eu seja melhor.
Foi pensando nisso que resolvi escrever um script em shell que tem o objetivo de trocar a senha do ou dos servidores de forma automática e enviar a mesma para um determinado email. Quando precisar acessar o servidor, basta acessar o email e pegar a última senha que foi enviada.
Esse script gera uma senha randômica contendo letras e números com quantidades de caracteres configuráveis como outras coisas. O script em si faz apenas isso, a parte de quantas vezes a nova senha gerada será enviada por email, pode ser determinada pelo cron(Um agendador de aplicativos).
Abaixo segue uma imagem contendo uma mensagem que foi enviada com a senha. Todo o assunto que aparece na imagem como o seu conteúdo é editável.
E abaixo segue o email aberto contendo, como exemplo, o usuário “bruna” e sua senha gerada com 17 caracteres.
Clique aqui para baixar o script.
Para configurar o script leia o arquivo leia.txt e o arquivo troca-senha.conf
Arquivo de configuração:
# Email para aonde a senha será enviada
EMAIL="seu@email.com"
# Assunto da mensagem.
ASSUNTO="Senha do Servidor"
# Nome ou número da máquina na rede.
MAQUINA=$(uname -n)
# Nome do usuário
USUARIO="usuario"
# Diretório que irá armazenar o arquivo de senha
DIR="/tmp"
# Quantidade de Caracteres que a nova senha terá
QUANTC="10"
# Formato da data
DATA=`date "+%T - %d/%m/%Y"`
Execução do script:
# Chama o arquivo de configuração
source /etc/troca-senha.conf
# Verifica se o arquivo passwd existe e o remove.
[ -e /etc/.passwd.txt ] && rm -f /tmp/.passwd.txt
# Gera a nova senha
mcookie | cut -c1-$QUANTC | tee -a $DIR/.passwd.txt
# Atribui a senha gerada ao usuário espscificado
PASSWORD="$(>$DIR/.passwd.txt
# Envia a senha para o email determinado
mpack -s "$ASSUNTO, Máquina: $MAQUINA - $DATA" $DIR/.passwd.txt $EMAIL
# Remove vestígios do mpack
rm -f /tmp/mpack*
# Remove o arquivo da senha criada anteriormente
rm -f $DIR/.passwd.txt
Agradecimentos a Luciano Martini pelas dicas em shellscrip.
Muito bom, legal para envio de logs usando o cron.
Magnificent site. Plenty of useful information here. I’m sending it to some friends ans additionally sharing in delicious. And certainly, thanks in your sweat! ddcbkcgdafab
Levitra Curativo stromectol walmart throat
buying cialis online reviews Finasteride is generally safe
I m so sorry about your mc I had mine in April too. clomid for women It also acts as a partial estrogen agonist in the hypothalamus resulting in an estrogenic negative feedback inhibition, thus increasing gonadotropins.
here compra casas ginecosid precio ciprofloxacino 500 levitra 10 mg precio en farmacia sobredosis amoxicilina medicamento vomitos embarazo ventas de casas en santiago de cuba. clomid pct dosing Treatment with nicotine plus ginseng in the dose of 1 g kg could increase the tissue SOD level, in comparison to the nicotine group P 0.
I had a bumpy red rash on my cheeks with Taxol is lasix potassium sparing
And for years he tries to protect a young slave from the whippings, rape and psychological torture at the hands of their evil master, played by Michael Fassbender, who is tortured himself by his love for the girl overnight cialis delivery
yasmin omeprazole dog overdose On Wednesday, the Federal Reserve, in its latest policystatement, gave no hint that a reduction in the pace of itsbond buying program was imminent, as the economy continues torecover but is still in need of support stromectol tablets for humans
hoe can i buy priligy in usa Some researchers have questioned the wisdom of chemotherapy in women with early stage disease, suggesting that the evidence for a durable impact on survival is marginal
levitra betamethasone valerate and neomycin skin cream betnovate n NEW YORK, Oct 2 Reuters Global equity markets and thedollar fell on Wednesday as the U tablet lasix As I scroll through these threads, I can t help but notice something that makes my heart sink
If the space on your plate is taken up by the healthier foods, you won t have as much room for the foods that are heavier cialis vs viagra
480 Iodinated glycerol theophylline; finpecia for sale What are the symptoms of pulmonary embolism
js安全 hello my website is js安全
tay ban hello my website is tay ban
bentuk piramida hello my website is bentuk piramida
tafsiri hello my website is tafsiri
h wedding hello my website is h wedding
lawan777 slot hello my website is lawan777 slot
all scarlet hello my website is all scarlet
totojitu jepan hello my website is totojitu jepan
62 nomor hello my website is 62 nomor
Sex, This is a good website Sex
Breast, This is a good website Breast
Sildenafil, This is a good website Sildenafil
Erectile, This is a good website Erectile
Dysfunction, This is a good website Dysfunction
Breast, This is a good website Breast
Nude, This is a good website Nude
Viagra, This is a good website Viagra
Prostate, This is a good website Prostate
What is the life expectancy for someone with COPD does ventolin hfa have steroids
What are the effects of chronic peripheral artery disease on erectile function order fildena for sale
Can I use online pharmacies for controlled substances? – buy sildenafil 100mg without prescription
Can I explore telemedicine services for affordable online consultations and prescriptions vidalista without prescription?
Can I request a different dosage schedule for my prescription, such as an as-needed basis canada vidalista – 5?
buy synthroid over the counter
azithromycin tablets price in india
We may collect personal information from you such as your name, email address, and contact details to provide you with the services and information you request. We may also collect non-personal information such as IP addresses and website usage patterns for statistical analysis and to improve our website and services. Please provide the address of the location you plan to use. This is necessary to optimise the mutual placement of various 1xBet agents and to be able to comply with the requirements of the law, particularly the absence of nearby educational institutions. 1xBet is a comprehensive online betting platform that caters to the diverse preferences of players. Whether you’re a passionate sports fan, a casino enthusiast, or a poker player, 1xBet offers a wide range of markets and betting options to suit your needs. Start your journey with extra bonus funds by using the promo code and delve into the thrilling world of 1xBet.
https://daemin.org/bbs/board.php?bo_table=free&wr_id=35674
The oddsmakers were clever with this line. The Cubs are a far superior club to the Marlins, but Miami has the ninth-easiest schedule remaining with three games apiece vs the Mets and Pirates. That’s a stomping ground if I’ve ever seen one, so Chicago can’t make any more mistakes. Errors like Seiya Suzuki’s botched fly ball vs the Braves Tuesday can’t be repeated. If you’re looking for other ways to get in on the MLB futures markets, check out our updated World Series odds. Sign up to receive our daily Morning Lineup to stay in the know about the latest trending topics around Major League Baseball. The Marlins continue to hang around in the MLB playoff race, but how long will they be able to? In order to give themselves a chance, they need to make the most of an upcoming nine-game homestand that consists of series against the Braves, Brewers, and Mets.
What role do state boards of pharmacy play in medicine regulation levitra vs cialis?