sudo nmcli con up/down id vpn-name

Startup a VPN connection through command line


1
By: madi
2012-09-29 08:11:26

These Might Interest You

  • Run this before you run a command in order to see what the command does as it starts. The -c flag is useful here as the PID is unknown before startup. All config files, libraries, logs, ports, etc used by the command as it starts up, (and shuts down) will be captured at 1s intervals and written to a file. Useful for debugging etc. Show Sample Output


    6
    sudo lsof -rc command >> /tmp/command.txt
    zlemini · 2011-08-03 20:19:53 0
  • When you SSH to a server who's hostname or IP has changed since the last time a connection was recorded in the known_hosts file a warning will be displayed since this indicated a possible DNS spoofing attack. If this is a known change then this command will remove the previous entry and allow the SSH connection. The SSH client will prompt you as if it was the first time connected to the server. Replace ${LINE} with the line of the offending key in ~known_hosts. 49 in the sample output. Show Sample Output


    -5
    sed '${LINE}d' ~/.ssh/known_host
    lucasrangit · 2012-01-16 18:00:12 3
  • SSH can be controlled trough an ~ escape sequence. Example, to terminate the current ssh connection, type a newline, then the ~ character, and last a . character. This is useful eg when an ssh connection hangs after you reboot a machine and the connection hangs. Show Sample Output


    31
    [enter]~?
    xeor · 2011-06-17 18:29:59 3
  • When a ssh connection with a remote server hangs or the connection is lost you can drop back to you local shell executing this key sequence.


    0
    CTRL+~ then .
    myahia · 2012-12-22 19:14:53 0
  • This runs the uptime command every 30 seconds to avoid an SSH connection dropping due to inactivity. Granted there are better ways of solving this problem but this is sometimes the right tool for the job.


    3
    watch -n 30 uptime
    root · 2009-01-27 14:49:21 2
  • This command will help you to find how many number of connection are made to given mysql and what are the different hosts connected to it with number of connection they are making. Show Sample Output


    0
    mysql -u root -p -e"show processlist;"|awk '{print $3}'|awk -F":" '{print $1}'|sort|uniq -c
    prasadwani · 2011-12-22 05:37:36 5

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: