New SSH key for a new different user | DigitalOcean (2024)

DigitalOcean
    • Log in to:
    • Community
    • DigitalOcean
    • Sign up for:
    • Community
    • DigitalOcean

Question

  • Posted on September 19, 2017
  • Linux BasicsUbuntu 16.04
  • New SSH key for a new different user | DigitalOcean (1)Asked by Mehmet Can Ertan

Hi everyone.

I have a my droplet with SSH key and it works properly. I created a new user in this droplet. I want to create a new SSH key for this new user. I will use this user for my php website. So, this new ssh key must be different from the root user key. How can I do that?

I’ve been doing a lot of research. But I could not find something that works.

You should be clear on the answers you provide. Because my english is not good. Thanks.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Mouhsen IbrahimSeptember 19, 2017

Accepted Answer

@TLod

Almost the same steps as before:

  • Generate a key pair using puttygen save the private key to your hard disk.
  • Copy the public key then log in to your droplet as root switch to your user su user then create a directory called .ssh in your home directory and create a file inside it called .authorized_keys and paste the public key there.
  • Open putty enter your droplet IP then browse to SSH -> auth then choose Browse... and open your private key which you saved before.
  • Open Connection -> data and enter your user name in Auto-login username
  • Go back to Session choose a name for your session and choose save now you can connect.

Hope this helps.

Mouhsen IbrahimSeptember 19, 2017

@TLod

  • You need to create a new ssh key pair using ssh-keygen BUT BE CAREFUL to change the name of the private key to something different that ~/.ssh/id_rsa, you can call it ~/.ssh/id_user_rsa.

  • Upload your new public key to the server with this command ssh-copy-id -i ~/.ssh/id_user_rsa user@droplet_ip, you will be prompted for your new user’s password here.

  • Then when you want to connect to your droplet using your new user use this command ssh -i ~/.ssh/id_user_rsa user@droplet_ip

Hint: if you need to create a shortcut you can use this file ~/.ssh/config add this content to it

Host user_droplet Hostname droplet_ip User user IdentityFile ~/.ssh/id_user_rsa

Now connect using this command ssh user_droplet

Hope this helps, revert back to me if you needed more help.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Popular Topics

  • Ubuntu
  • Linux Basics
  • JavaScript
  • Python
  • MySQL
  • Docker
  • Kubernetes
  • All tutorials
  • Talk to an expert

Featured on Community

New SSH key for a new different user | DigitalOcean (2)

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up

New SSH key for a new different user | DigitalOcean (3)

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Learn more

New SSH key for a new different user | DigitalOcean (4)

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Learn more

Featured Tutorials

Kubernetes CourseLearn Python 3Machine Learning in PythonGetting started with GoIntro to Kubernetes

DigitalOcean Products

App PlatformVirtual MachinesManaged DatabasesManaged KubernetesBlock StorageObject StorageMarketplaceVPCLoad Balancers

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more

© 2024 DigitalOcean, LLC.Sitemap.

New SSH key for a new different user | DigitalOcean (2024)
Top Articles
Top 5 Benefits of An Accelerator Program
Add & customize your Search widget - Android
Phcs Medishare Provider Portal
Wizard Build Season 28
Davante Adams Wikipedia
Martha's Vineyard Ferry Schedules 2024
Activities and Experiments to Explore Photosynthesis in the Classroom - Project Learning Tree
The Potter Enterprise from Coudersport, Pennsylvania
DENVER Überwachungskamera IOC-221, IP, WLAN, außen | 580950
Konkurrenz für Kioske: 7-Eleven will Minisupermärkte in Deutschland etablieren
Doby's Funeral Home Obituaries
Pbr Wisconsin Baseball
Slay The Spire Red Mask
Infinite Campus Parent Portal Hall County
Bj Alex Mangabuddy
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Forest Biome
Apple Original Films and Skydance Animation’s highly anticipated “Luck” to premiere globally on Apple TV+ on Friday, August 5
Is A Daytona Faster Than A Scat Pack
Transactions (zipForm Edition) | Lone Wolf | Real Estate Forms Software
Evil Dead Rise Showtimes Near Regal Sawgrass & Imax
Titanic Soap2Day
Www.dunkinbaskinrunsonyou.con
European city that's best to visit from the UK by train has amazing beer
3 2Nd Ave
Ficoforum
The Banshees Of Inisherin Showtimes Near Broadway Metro
Tomb Of The Mask Unblocked Games World
Obituaries, 2001 | El Paso County, TXGenWeb
Miller Plonka Obituaries
Does Royal Honey Work For Erectile Dysfunction - SCOBES-AR
Datingscout Wantmatures
Purdue Timeforge
Kltv Com Big Red Box
Spy School Secrets - Canada's History
The Hoplite Revolution and the Rise of the Polis
A Man Called Otto Showtimes Near Carolina Mall Cinema
The Bold And The Beautiful Recaps Soap Central
Hebrew Bible: Torah, Prophets and Writings | My Jewish Learning
Koninklijk Theater Tuschinski
Barstool Sports Gif
Achieving and Maintaining 10% Body Fat
Swoop Amazon S3
Brown launches digital hub to expand community, career exploration for students, alumni
Ucla Basketball Bruinzone
Spurs Basketball Reference
Headlining Hip Hopper Crossword Clue
Stoughton Commuter Rail Schedule
Big Brother 23: Wiki, Vote, Cast, Release Date, Contestants, Winner, Elimination
Germany’s intensely private and immensely wealthy Reimann family
Greg Steube Height
What your eye doctor knows about your health
Latest Posts
Article information

Author: Rob Wisoky

Last Updated:

Views: 6173

Rating: 4.8 / 5 (48 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Rob Wisoky

Birthday: 1994-09-30

Address: 5789 Michel Vista, West Domenic, OR 80464-9452

Phone: +97313824072371

Job: Education Orchestrator

Hobby: Lockpicking, Crocheting, Baton twirling, Video gaming, Jogging, Whittling, Model building

Introduction: My name is Rob Wisoky, I am a smiling, helpful, encouraging, zealous, energetic, faithful, fantastic person who loves writing and wants to share my knowledge and understanding with you.