Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cranspasswords
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Stan
Cranspasswords
Commits
8d1d2984
Commit
8d1d2984
authored
11 years ago
by
Daniel STAN
Browse files
Options
Downloads
Patches
Plain Diff
sudo -n pour éviter le askpass qui ne marchera
parent
23ff2d58
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README
+9
-0
9 additions, 0 deletions
README
clientconfig.example.py
+4
-4
4 additions, 4 deletions
clientconfig.example.py
server
+3
-1
3 additions, 1 deletion
server
with
16 additions
and
5 deletions
README
+
9
−
0
View file @
8d1d2984
...
@@ -38,6 +38,15 @@ avant de lancer make install ou make install-server.
...
@@ -38,6 +38,15 @@ avant de lancer make install ou make install-server.
* Éditez /etc/cranspasswords/serverconfig.py pour qu'il soit conforme
* Éditez /etc/cranspasswords/serverconfig.py pour qu'il soit conforme
à vos désirs.
à vos désirs.
== Troubleshoutings ==
"""sudo: sorry, a password is required to run sudo"""
Côté client: Vérifier le ``server_path`` et les variables en dépendant,
dans le serverconfig.py. S'assurer qu'il n'existe pas de
clientconfig.py[c] résiduel dans le dossier de cranspasswords.
Côté serveur, s'assurer que le serveur est intallé au bon endroit
(/usr/local/bin/$NAME-server) et que le fichier sudoers est bien
installé (/etc/sudoers.d/$NAME) pour lancer le sudo sans mot de passe
== Complétion ==
== Complétion ==
* Pour avoir la bash-complétion, dans votre .bashrc :
* Pour avoir la bash-complétion, dans votre .bashrc :
* Sourcez le fichier bash_completion présent dans le dépôt
* Sourcez le fichier bash_completion présent dans le dépôt
...
...
This diff is collapsed.
Click to expand it.
clientconfig.example.py
+
4
−
4
View file @
8d1d2984
...
@@ -15,7 +15,7 @@ ssh_path = '/usr/bin/ssh'
...
@@ -15,7 +15,7 @@ ssh_path = '/usr/bin/ssh'
server_path
=
'
/usr/local/bin/%s-server
'
%
(
cmd_name
,)
server_path
=
'
/usr/local/bin/%s-server
'
%
(
cmd_name
,)
#: Commande à exécuter sur le serveur après y être entré en ssh
#: Commande à exécuter sur le serveur après y être entré en ssh
distant_cmd
=
"
sudo
%s
"
%
(
server_path
,)
distant_cmd
=
[
"
sudo
"
,
'
-n
'
,
server_path
]
#: Liste des serveurs sur lesquels ont peut récupérer des mots de passe.
#: Liste des serveurs sur lesquels ont peut récupérer des mots de passe.
#:
#:
...
@@ -25,13 +25,13 @@ distant_cmd = "sudo %s" % (server_path,)
...
@@ -25,13 +25,13 @@ distant_cmd = "sudo %s" % (server_path,)
#: le script sur le serveur distant.
#: le script sur le serveur distant.
servers
=
{
servers
=
{
'
default
'
:
{
'
default
'
:
{
'
server_cmd
'
:
[
ssh_path
,
'
vert.adm.crans.org
'
,
distant_cmd
]
,
'
server_cmd
'
:
[
ssh_path
,
'
vert.adm.crans.org
'
]
+
distant_cmd
,
},
},
# Utile pour tester
# Utile pour tester
'
localhost
'
:
{
'
localhost
'
:
{
'
server_cmd
'
:
[
ssh_path
,
'
localhost
'
,
distant_cmd
]
,
'
server_cmd
'
:
[
ssh_path
,
'
localhost
'
]
+
distant_cmd
,
},
},
'
ovh
'
:
{
'
ovh
'
:
{
'
server_cmd
'
:
[
ssh_path
,
'
ovh.crans.org
'
,
distant_cmd
]
,
'
server_cmd
'
:
[
ssh_path
,
'
ovh.crans.org
'
]
+
distant_cmd
,
}
}
}
}
This diff is collapsed.
Click to expand it.
server
+
3
−
1
View file @
8d1d2984
#!/bin/bash
#!/bin/bash
# sudo-wrapper pour exécuter cranspasswords côté serveur
# sudo-wrapper pour exécuter cranspasswords côté serveur
# Beware : code potentiellement mort (clientconfig fait un appel immédiat à sudo)
# -- DS 01/08/2013
cmd_name
=
cranspasswords
cmd_name
=
cranspasswords
sudo
/usr/local/bin/
${
cmd_name
}
/server.py
$*
sudo
-n
/usr/local/bin/
${
cmd_name
}
/server.py
$*
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment